-
-
Notifications
You must be signed in to change notification settings - Fork 1
163 lines (136 loc) · 4.19 KB
/
test.yml
File metadata and controls
163 lines (136 loc) · 4.19 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Test
on:
pull_request:
types:
- synchronize
- opened
- reopened
- unlocked
paths:
- "src/extension/**"
- "src/view/**"
push:
branches:
- main
paths:
- "src/extension/**"
- "src/view/**"
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4]
shardTotal: [4]
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup environment
uses: ./.github/actions/setup-env
with:
enable-turbo-cache: "true"
cache-suffix: "test"
- name: Install dependencies
run: just deps-compact
- name: Run tests with coverage (shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
run: just test extension coverage "${{ matrix.shardIndex }}/${{ matrix.shardTotal }}"
- name: Upload coverage artifact
uses: actions/upload-artifact@v6
with:
name: coverage-${{ matrix.shardIndex }}
path: src/extension/coverage/
retention-days: 1
coverage-merge:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup Node 22
uses: actions/setup-node@v6
with:
node-version: "22.18.0"
- name: Download all coverage artifacts
uses: actions/download-artifact@v7
with:
pattern: coverage-*
path: coverage-artifacts/
- name: Merge coverage reports
run: |
npm install -g nyc
mkdir -p merged-coverage
# Copy all coverage-final.json files with unique names
for dir in coverage-artifacts/coverage-*; do
shard=$(basename "$dir" | sed 's/coverage-//')
if [ -f "$dir/coverage-final.json" ]; then
cp "$dir/coverage-final.json" "merged-coverage/coverage-$shard.json"
fi
done
# Merge and generate report
nyc merge merged-coverage merged-coverage/coverage.json
nyc report --reporter=lcov --reporter=text --temp-dir=merged-coverage --report-dir=coverage-report
- name: Upload merged coverage report
uses: actions/upload-artifact@v6
with:
name: coverage-report
path: coverage-report/
retention-days: 30
e2e-ui-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4]
shardTotal: [4]
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup environment
uses: ./.github/actions/setup-env
- name: Install dependencies
run: just deps
- name: Run E2E tests (shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
run: just test e2e-ui "" "${{ matrix.shardIndex }}/${{ matrix.shardTotal }}"
- name: Upload blob report
if: always()
uses: actions/upload-artifact@v6
with:
name: blob-report-${{ matrix.shardIndex }}
path: src/view/blob-report/
retention-days: 1
- name: Upload test traces
if: failure()
uses: actions/upload-artifact@v6
with:
name: playwright-traces-${{ matrix.shardIndex }}
path: src/view/test-results/
retention-days: 30
e2e-report-merge:
runs-on: ubuntu-latest
needs: e2e-ui-test
if: always()
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup environment
uses: ./.github/actions/setup-env
- name: Install view dependencies
run: cd src/view && pnpm install
- name: Download all blob reports
uses: actions/download-artifact@v7
with:
pattern: blob-report-*
path: all-blob-reports/
merge-multiple: true
- name: Merge reports
run: |
cd src/view
pnpm exec playwright merge-reports --reporter=html ../../all-blob-reports
- name: Upload merged HTML report
uses: actions/upload-artifact@v6
with:
name: playwright-report
path: src/view/playwright-report/
retention-days: 30