-
Notifications
You must be signed in to change notification settings - Fork 51
120 lines (100 loc) · 3.06 KB
/
Copy pathtest.yml
File metadata and controls
120 lines (100 loc) · 3.06 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
name: Frontend Build Check
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
actions: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
- name: Install Dependencies
run: npm ci
- name: Run Linter
run: npm run lint
- name: Enforce Unit Test Coverage
run: npm run test:coverage
- name: Upload Coverage Report
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/
if-no-files-found: error
- name: Check Build
run: npm run build
accessibility:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
- name: Install Dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install chromium --with-deps
- name: Build Application
run: npm run build
- name: Run Accessibility E2E Tests (axe-core)
run: npx playwright test e2e/a11y.spec.ts --project=wallet-ci 2>&1 | tee a11y-output.log
- name: Upload Accessibility Report
if: always()
uses: actions/upload-artifact@v4
with:
name: a11y-report
path: a11y-output.log
if-no-files-found: ignore
performance:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
- name: Install Dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install chromium --with-deps
- name: Build Application
run: npm run build
- name: Run Performance Benchmarks
id: perf-test
run: npx playwright test tests/performance/ --reporter=list
continue-on-error: true
- name: Upload Performance Metrics
uses: actions/upload-artifact@v4
with:
name: perf-metrics
path: tests/performance/current-metrics.json
if-no-files-found: ignore
- name: Compare Against Baseline
id: perf-compare
run: npx tsx tests/performance/compare-baseline.ts tests/performance/current-metrics.json
continue-on-error: true
- name: Update Baseline on Main
if: github.ref == 'refs/heads/main'
run: |
PERF_UPDATE_BASELINE=true npx tsx tests/performance/compare-baseline.ts tests/performance/current-metrics.json
- name: Fail on Regression
if: steps.perf-test.outcome == 'failure' || steps.perf-compare.outcome == 'failure'
run: |
echo "Performance regression detected or benchmark failed."
exit 1