-
-
Notifications
You must be signed in to change notification settings - Fork 866
89 lines (69 loc) · 2.96 KB
/
nodejs.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Run tests on push
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 13.x, 14.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
name: Test on node ${{ matrix.node-version }} and ${{ matrix.os }} with ${{ matrix.webpack }}
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%S')"
- name: Log date
run: echo "${{ steps.date.outputs.date }}"
- name: Set default run status
run: echo "::set-output name=last_run_status::default" > last_run_status
- name: Restore last run status
id: last_run
uses: actions/cache@v2
with:
path: |
last_run_status
key: ${{ github.run_id }}-${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.webpack }}-${{ steps.date.outputs.date }}
restore-keys: |
${{ github.run_id }}-${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.webpack }}-
- name: Set last run status
id: last_run_status
run: cat last_run_status
- name: Log last run status
run: echo "${{ steps.last_run_status.outputs.last_run_status }}"
- uses: actions/checkout@v1
if: steps.last_run_status.outputs.last_run_status != 'success'
- name: Use Node.js ${{ matrix.node-version }}
if: steps.last_run_status.outputs.last_run_status != 'success'
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install elm globally
if: steps.last_run_status.outputs.last_run_status != 'success'
run: yarn global add elm
- name: Restore lerna
id: cache
if: steps.last_run_status.outputs.last_run_status != 'success'
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.webpack }}-${{ hashFiles('**/yarn.lock') }}
- name: Install and bootstrap packages
if: steps.cache.outputs.cache-hit != 'true' && steps.last_run_status.outputs.last_run_status != 'success'
run: yarn install --frozen-lockfile --ignore-engines --network-timeout 1000000
- name: Install ${{ matrix.webpack }}
if: steps.cache.outputs.cache-hit != 'true' && steps.last_run_status.outputs.last_run_status != 'success'
run: yarn add -WD ${{ matrix.webpack }} --ignore-engines --network-timeout 1000000
- name: Run tests
id: test_run
if: steps.last_run_status.outputs.last_run_status != 'success'
run: yarn test --runInBand --coverage
env:
CI: true
WARNINGS_ERRORS_DISABLE: true
- name: Save run status
if: steps.last_run_status.outputs.last_run_status != 'success'
run: echo "::set-output name=last_run_status::${{ steps.test_run.outcome }}" > last_run_status