-
Notifications
You must be signed in to change notification settings - Fork 2
183 lines (154 loc) · 4.66 KB
/
Copy pathci.yml
File metadata and controls
183 lines (154 loc) · 4.66 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
name: "CI"
on:
push:
branches:
- main
- feat/*
- fix/*
- perf/*
pull_request:
branches:
- main
- feat/*
- fix/*
- perf/*
permissions:
contents: read
actions: read
checks: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
pull-requests: write
jobs:
changes:
name: Check Changed Files
if: github.event_name == 'pull_request'
timeout-minutes: 5
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
ui: ${{ steps.filter.outputs.ui }}
packages: ${{ steps.filter.outputs.packages }}
steps:
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
ui:
- 'src/**'
packages:
- 'packages/**'
unit-test:
name: Run Unit Tests
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v7
- name: Install Node.js
uses: actions/setup-node@v7
with:
node-version-file: ".node-version"
cache: "npm"
# Set up GitHub Actions caching for Wireit.
- uses: google/wireit@setup-github-actions-caching/v2
- name: Install NPM Dependencies
run: npm ci
- name: Run Unit Tests
run: npm run ci:test:unit
- name: Generate Test Report
uses: dorny/test-reporter@v3
if: success() || failure()
with:
name: Unit Test Results
path: tests/results/test-results-unit-junit.xml
token: ${{ secrets.GITHUB_TOKEN }}
reporter: java-junit
- name: "Upload JSON for badge"
uses: actions/upload-artifact@v7
with:
name: test-results-unit
path: tests/results/test-results-unit.json
browser:
name: Run Browser E2E Tests
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v7
- name: Install Node.js
uses: actions/setup-node@v7
with:
node-version-file: ".node-version"
cache: "npm"
# Set up GitHub Actions caching for Wireit.
- uses: google/wireit@setup-github-actions-caching/v2
- name: Install NPM Dependencies
run: npm ci
- name: Cache Playwright
uses: actions/cache@v6
with:
key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-playwright-
path: ~/.cache/ms-playwright
- name: Install Playwright
run: npx playwright install chromium
- name: Run Browser Tests
run: npm run ci:test:browser
- name: Generate Test Report
uses: dorny/test-reporter@v3
if: success() || failure()
with:
name: Browser Test Results
path: tests/results/test-results-browser-junit.xml
reporter: java-junit
token: ${{ secrets.GITHUB_TOKEN }}
- name: "Upload JSON for badge"
uses: actions/upload-artifact@v7
with:
name: test-results-browser
path: tests/results/test-results-browser.json
coverage:
name: Code Coverage
runs-on: ubuntu-latest
timeout-minutes: 10
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout Repo
uses: actions/checkout@v7
- name: Install Node.js
uses: actions/setup-node@v7
with:
node-version-file: ".node-version"
cache: "npm"
# Set up GitHub Actions caching for Wireit.
- uses: google/wireit@setup-github-actions-caching/v2
- name: Install NPM Dependencies
run: npm ci
- name: Cache Playwright
uses: actions/cache@v6
with:
key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-playwright-
path: ~/.cache/ms-playwright
- name: Install Playwright
run: npx playwright install chromium
- name: Check Code Coverage
run: npm run ci:coverage
- name: Generate Coverage Report
if: always() # still generate if tests failing
uses: davelosert/vitest-coverage-report-action@v2
with:
name: "Package"
vite-config-path: "./tests/configs/vitest/ci-coverage.config.js"
json-summary-path: "./tests/coverage/coverage-summary.json"
json-final-path: "./tests/coverage/coverage-final.json"
file-coverage-mode: "changes"
- name: "Upload JSON for badge"
uses: actions/upload-artifact@v7
with:
name: coverage-summary
path: tests/coverage/coverage-summary.json