-
Notifications
You must be signed in to change notification settings - Fork 4
47 lines (45 loc) · 1.17 KB
/
continuous-integration.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
name: Continuous Integration
on:
# branches pushed by collaborators
push:
branches:
- master
# pull request from non-collaborators
pull_request: {}
# nightly
schedule:
- cron: '0 0 * * *'
jobs:
build:
name: "Test: ${{ matrix.os }}, node ${{ matrix.node }}"
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows]
node:
- 18
- 17
- 16
- 14
- 12
steps:
# checkout code
- uses: actions/checkout@v2
# install node
- name: Use Node.js ${{ matrix.os }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
# npm install with caching
- run: |
npm config set cache "$( node -p "process.cwd()" )/temp/npm-cache"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: temp/npm-cache
key: npm-cache-${{ matrix.os }} ${{ matrix.node }}-${{ hashFiles('package-lock.json') }}
# restore-keys: npm-cache-${{ matrix.os }} ${{ matrix.node }}-
- run: npm install
# Run tests
- run: npm test