-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (89 loc) · 2.36 KB
/
main.yml
File metadata and controls
108 lines (89 loc) · 2.36 KB
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
name: merge-code-coverage
on:
workflow_dispatch:
push:
branches: ["main"]
permissions:
contents: read
pages: write
id-token: write
jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm i
- run: npm run test:unit
env:
FORCE_COLOR: true
- uses: actions/upload-artifact@v4
if: always()
with:
name: unit-test
path: coverage-reports/unit
retention-days: 1
e2e-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2]
shardTotal: [2]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm i
- run: npx playwright install --with-deps
- run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
env:
FORCE_COLOR: true
- uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-test-shard-${{ matrix.shardIndex }}
path: coverage-reports/e2e
retention-days: 1
merge-coverage:
name: merge-coverage
runs-on: ubuntu-latest
needs: [unit-test, e2e-test]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download unit coverage
uses: actions/download-artifact@v4
with:
name: unit-test
path: coverage-reports/unit
- name: Download e2e coverage
uses: actions/download-artifact@v4
with:
pattern: e2e-test-shard-*
path: coverage-reports/e2e
merge-multiple: true
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm i
- run: npm run test:merge
env:
FORCE_COLOR: true
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './coverage-reports'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4