-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (48 loc) · 1.18 KB
/
build-and-test.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
name: build-and-test
on:
pull_request:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Node 16
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
- name: NPM Install
run: npm ci
- name: Build
run: npm run build
test:
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Node 16
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
- name: NPM Install
run: npm ci
- name: Test
run: npm run test:prod
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
continue-on-error: true
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: test-results/**/*.xml