-
Notifications
You must be signed in to change notification settings - Fork 4
67 lines (58 loc) · 1.48 KB
/
build-and-test.yaml
File metadata and controls
67 lines (58 loc) · 1.48 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
name: Build and Test
on: [workflow_call]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: '.'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js '20.x'
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: npm
cache-dependency-path: ./package-lock.json
- run: npm ci --ignore-scripts
- run: npm rebuild && npm run prepare --if-present
- run: npm run lint
- run: npm run audit
- run: npm run build
- name: Upload artifact
if: ${{ github.ref_name == 'main' }}
uses: actions/upload-artifact@v4
with:
name: dist
path: 'dist'
if-no-files-found: error
test:
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest']
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
working-directory: '.'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js '20.x'
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: npm
cache-dependency-path: ./package-lock.json
- run: npm ci --ignore-scripts
- run: npm rebuild && npm run prepare --if-present
- name: Test
uses: coactions/setup-xvfb@v1
with:
run: npm run test