-
Notifications
You must be signed in to change notification settings - Fork 6
76 lines (66 loc) · 1.76 KB
/
ci.yml
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
name: Continuous Integration
run-name: Node.js CI
on:
workflow_call: # required when creating a reusable workflow
inputs:
config-path:
required: false
type: string
secrets:
token:
required: false
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: '20.x'
cache: 'npm'
- name: Clean install
run: npm ci
- name: Run linter
run: npm run lint
- name: Compile typescript
run: npm run compile
- name: Jest unit tests
run: npm run unit:tests
- name: Test coverage
run: npm run test:coverage
# - name: Run Redux/State Management Tests
# run: npm run redux:tests
#
# - name: Run Component Tests
# run: npm run test:components
#
# - name: Run End-to-End Tests
# run: npm run test:e2e
#
# - name: Run Snapshot Tests
# run: npm run test:snapshot
#
# - name: Run Routing Tests
# run: npm run test:routing
#
# - name: Run API Tests
# run: npm run test:api
#
# - name: Run Integration Tests
# run: npm run test:integration
- name: Build App
run: npm run build --if-present
# https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts
- name: Archive Next.js build
uses: actions/upload-artifact@v4
with:
name: next.js-build
path: .next/
retention-days: 14
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: docs/coverage/index.html
retention-days: 14