-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (41 loc) · 1.73 KB
/
ci-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
name: ci-test
on:
push:
branches:
- '**'
env:
cache-version: 20201129
# for allow reset npm cache path on win32, revert: https://github.com/actions/virtual-environments/blob/win19/20201116.1/images/win/scripts/Installers/Install-NodeLts.ps1#L21
npm_config_cache: '' # wait for fix: https://github.com/actions/virtual-environments/pull/2153
jobs:
build:
strategy:
fail-fast: false # allow all test to run to the end
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
node-version: [ 14.x, 15.x ]
runs-on: ${{ matrix.os }}
steps:
- name: Setup Git repo
uses: actions/checkout@v2 # https://github.com/actions/checkout
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1 # https://github.com/actions/setup-node
with:
node-version: ${{ matrix.node-version }}
- name: Patch & log CI info
run: |
npx @dr-js/core@^0.4.3 -eI .github/ci-patch.js
dr-dev -c .github/cache/config.js --cache-step setup
- name: Cache JS
uses: actions/cache@v2 # https://github.com/actions/cache
with:
key: ${{ runner.os }}-${{ env.cache-version }}-${{ matrix.node-version }}-${{ hashFiles('.github/cache/temp-gitignore/checksum-file') }}
restore-keys: ${{ runner.os }}-${{ env.cache-version }}-${{ matrix.node-version }}-
path: |
.github/cache/persist-gitignore/
~/.npm/
- run: dr-dev -c .github/cache/config.js --cache-step mark
- run: npm ci
# TODO: TEMP FIX: use npm@6 and wait for: https://github.com/npm/cli/issues/2411
- run: npx npm@6 test
- run: dr-dev -c .github/cache/config.js --cache-step prune