-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (89 loc) · 2.67 KB
/
ci.yml
File metadata and controls
107 lines (89 loc) · 2.67 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
checks: write
pull-requests: write
jobs:
ci:
name: Lint, Test & Build
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- name: Lint
run: npm run lint
- name: Test with coverage
run: npm run test:ci
- name: Upload test results
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: test-results
path: test-results/
retention-days: 30
- name: Upload coverage
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: coverage
path: coverage/
retention-days: 30
- name: Test report
uses: dorny/test-reporter@v2
if: ${{ !cancelled() }}
with:
name: 'Unit Tests'
path: test-results/junit.xml
reporter: java-junit
fail-on-error: true
- name: Coverage report
uses: davelosert/vitest-coverage-report-action@v2
if: always()
with:
name: 'Coverage'
file-coverage-mode: 'changes'
- name: Cache Next.js build
uses: actions/cache@v4
with:
path: .next/cache
key: nextjs-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('src/**') }}
restore-keys: |
nextjs-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}-
nextjs-${{ runner.os }}-
- name: Build
run: npm run build
- name: Install Playwright Chromium
run: npx playwright install --with-deps chromium
- name: Self-scan accessibility tests
run: npm run test:a11y
- name: Upload accessibility report
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: a11y-results
path: |
playwright-report/
test-results/a11y-junit.xml
retention-days: 30
- name: Accessibility test report
uses: dorny/test-reporter@v2
if: ${{ !cancelled() }}
with:
name: 'Accessibility Tests'
path: test-results/a11y-junit.xml
reporter: java-junit
fail-on-error: true