-
Notifications
You must be signed in to change notification settings - Fork 115
113 lines (108 loc) · 3.11 KB
/
test.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: test
on:
push:
branches: [ master ]
pull_request:
jobs:
test-unit:
name: Tests (unit tests)
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: "0" # necessary for `npm run print-version`
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.17
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Unit tests
run: npm test
# note to self: the sections test-public and test-local should be almost the same, except:
# - local testing needs git submodules
# - `npm run test:e2e` v.s. `npm run test:e2e:local`
# - some names should be different
test-public:
name: Tests (public testing server)
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: "0" # necessary for `npm run print-version`
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.17
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: End-to-End tests
env:
TEST_SAFARI: yes
run: npm run test:e2e
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report-public/
retention-days: 30
- name: Report coverage
id: report
if: always()
run: npm run test:lcov
- name: Upload E2E test coverage
if: steps.report.outcome == 'success'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info
flags: e2etests-public
fail_ci_if_error: true
test-local:
name: Tests (local testing server)
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: "0" # necessary for `npm run print-version`
submodules: "recursive" # necessary for miniChRIS and example-dicoms
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.17
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Setup tests
run: npm run test:prepare
- name: End-to-End tests
env:
TEST_SAFARI: yes
run: npm run test:e2e:local
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report-local/
retention-days: 30
- name: Report coverage
id: report
if: always()
run: npm run test:lcov
- name: Upload E2E test coverage
if: steps.report.outcome == 'success'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info
flags: e2etests-local
fail_ci_if_error: true