-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (55 loc) · 1.6 KB
/
ci_tests.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
name: Run tests
on:
push:
branches:
- '**'
tags-ignore:
- '**'
pull_request:
workflow_call:
workflow_dispatch:
concurrency:
group: run-tests-group-${{ github.ref }}
cancel-in-progress: true
jobs:
ci_tests:
name: Tests on ${{ matrix.os }} node${{ matrix.node }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [18, 20]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
registry-url: https://registry.npmjs.org/
cache: npm
# https://github.com/actions/setup-node/issues/411
# https://github.com/npm/cli/issues/4341
- name: Workaround for npm installation on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: npm install -g [email protected]
- name: Install latest npm
run: npm install -g npm@latest
- name: Cache node_modules
uses: actions/cache@v3
id: cache-step
with:
key: cache-${{ matrix.os }}-node${{ matrix.node }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
cache-${{ matrix.os }}-node${{ matrix.node }}-
path: |
node_modules
- name: Install dependencies
if: steps.cache-step.outputs.cache-hit != 'true'
run: npm clean-install --engine-strict
- name: Lint
run: npm run lint
- name: Tests
run: npm run test
- name: Build
run: npm run build