-
-
Notifications
You must be signed in to change notification settings - Fork 29
46 lines (46 loc) · 1.36 KB
/
npm-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
name: test
on:
push:
pull_request:
branches: [master]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
node_version:
- 14
- 16
- 18
architecture:
- x64
# an extra windows-x86 run:
include:
- os: windows-latest
node_version: 14
architecture: x86
name: Node ${{ matrix.node_version }} - ${{ matrix.architecture }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.architecture }}
cache: "npm"
- name: Install latest npm with workaround for windows and node 14
# Fix for windows bug when installing npm 9 with node 14
# https://github.com/actions/setup-node/issues/623#issuecomment-1313381044
if: matrix.node_version == 14 && matrix.os == 'windows-latest'
run: npm i -g npm@8 && npm i -g npm@latest
- name: Install latest npm
if: matrix.node_version != 14 || matrix.os != 'windows-latest'
run: npm i -g npm@latest
- name: Clean install dependencies
run: npm ci
- name: Run tests
run: npm test