-
Notifications
You must be signed in to change notification settings - Fork 83
80 lines (67 loc) · 2.11 KB
/
tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: tests
on:
workflow_dispatch:
pull_request:
permissions:
contents: read
packages: read
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '20.5'
cache: 'yarn'
registry-url: 'https://npm.pkg.github.com'
- name: Set yarn version
run: |
yarn set version stable
yarn set version 3.6.4
- name: Setup .yarnrc.yml
run: |
yarn config set nodeLinker node-modules
yarn config set npmScopes.plentymarkets.npmRegistryServer "https://npm.pkg.github.com"
yarn config set npmScopes.plentymarkets.npmAlwaysAuth true
yarn config set npmScopes.plentymarkets.npmAuthToken $NODE_AUTH_TOKEN
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set environment
run: |
touch apps/web/.env
cat <<EOT >> apps/web/.env
API_SECURITY_TOKEN=${{ secrets.API_SECURITY_TOKEN }}
API_ENDPOINT=https://mevofvd5omld.c01-14.plentymarkets.com
DEFAULT_FEEDBACK_ITEMS_PER_PAGE=1
${{ vars.CONFIG }}
EOT
- name: Install Dependencies
run: yarn --immutable
- name: Unit tests
run: |
pushd ${{ github.workspace }}/apps/server/
yarn start &
pushd ${{ github.workspace }}/apps/web/
yarn test:coverage
pushd -0 && dirs -c
- name: E2E tests
uses: cypress-io/github-action@v5
with:
build: yarn build
install: false
command: yarn test:cypress
env:
PAYPAL_EMAIL: ${{ secrets.PAYPAL_EMAIL }}
PAYPAL_PASSWORD: ${{ secrets.PAYPAL_PASSWORD }}
CYPRESS_DEFAULT_FEEDBACK_ITEMS_PER_PAGE: 1
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: apps/web/__tests__/report/screenshots
if-no-files-found: ignore