-
Notifications
You must be signed in to change notification settings - Fork 42
92 lines (74 loc) · 2.37 KB
/
e2e-tests.yml
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
81
82
83
84
85
86
87
88
89
90
91
92
# this is reference workflow to run e2e tests and get test results
name: e2e-tests
on:
workflow_dispatch:
pull_request:
jobs:
e2e-test:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Read .nvmrc
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
id: nvmrc
- name: setup node ${{ steps.nvmrc.outputs.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: '${{ steps.nvmrc.outputs.NODE_VERSION }}'
registry-url: 'https://registry.npmjs.org'
# added to build react-storybook for testing
- name: install dependencies
run: |
yarn config set network-timeout 300000
yarn
- name: build design tokens package
run: yarn build
working-directory: ./packages/design-tokens
- name: build core package
run: yarn build
working-directory: ./packages/core
- name: build core storybook
run: yarn build-storybook
working-directory: ./packages/core
- name: build react package
run: yarn build
working-directory: ./packages/react
- name: build react storybook
run: yarn build-storybook
working-directory: ./packages/react
# added to build react-storybook for testing
- name: install dependencies
run: |
yarn config set network-timeout 300000
yarn
working-directory: ./e2e
- name: install playwright browser and OS dependencies
run: |
yarn playwright-install
working-directory: ./e2e
- name: run tests
run: |
yarn start
env:
E2E_TESTS_ENV_URL: 'https://hds.hel.fi'
working-directory: ./e2e
- name: upload test results in case of failure
uses: actions/upload-artifact@v4
with:
name: e2e_test_report
path: e2e/report/
include-hidden-files: true
if: failure()
- name: upload screenshot differences in case of failure
uses: actions/upload-artifact@v4
with:
name: e2e_test_results
path: e2e/test-results/
if: failure()
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
e2e/report/**/*.xml