Skip to content

Commit 548d1be

Browse files
authored
Merge pull request #1815 from bitcoinjs/fix/githubactions
Update setup-node action to use matrix and lts notation
2 parents 59b2116 + 04784e4 commit 548d1be

File tree

5 files changed

+996
-802
lines changed

5 files changed

+996
-802
lines changed

.github/workflows/main_ci.yml

Lines changed: 58 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,88 +10,117 @@ permissions:
1010
contents: read
1111

1212
jobs:
13-
audit:
13+
##################
14+
# Jobs with matrix
15+
##################
16+
unit:
1417
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
node-version: [14, 'lts/*']
22+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
1523
steps:
1624
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
17-
- uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1
25+
- name: Use Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3
1827
with:
19-
node-version: 12
28+
node-version: ${{ matrix.node-version }}
2029
registry-url: https://registry.npmjs.org/
30+
cache: 'npm'
2131
- run: npm ci
22-
- run: npm run audit
23-
unit:
32+
- run: npm run unit
33+
integration:
2434
runs-on: ubuntu-latest
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
node-version: [14, 'lts/*']
39+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
40+
services:
41+
regtest:
42+
image: junderw/bitcoinjs-regtest-server@sha256:5b69cf95d9edf6d5b3a00504665d6b3c382a6aa3728fe8ce897974c519061463
43+
ports:
44+
- 8080:8080
2545
steps:
2646
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
27-
- uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1
47+
- name: Use Node.js ${{ matrix.node-version }}
48+
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3
2849
with:
29-
node-version: 12
50+
node-version: ${{ matrix.node-version }}
3051
registry-url: https://registry.npmjs.org/
52+
cache: 'npm'
3153
- run: npm ci
32-
- run: npm run unit
33-
coverage:
54+
- run: APIURL=http://127.0.0.1:8080/1 npm run integration
55+
56+
57+
58+
#####################
59+
# Jobs without matrix
60+
#####################
61+
audit:
3462
runs-on: ubuntu-latest
3563
steps:
3664
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
37-
- uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1
65+
- uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3
3866
with:
39-
node-version: 12
67+
node-version: 'lts/*'
4068
registry-url: https://registry.npmjs.org/
69+
cache: 'npm'
4170
- run: npm ci
42-
- run: npm run coverage
43-
integration:
71+
- run: npm run audit
72+
coverage:
4473
runs-on: ubuntu-latest
45-
services:
46-
regtest:
47-
image: junderw/bitcoinjs-regtest-server@sha256:5b69cf95d9edf6d5b3a00504665d6b3c382a6aa3728fe8ce897974c519061463
48-
ports:
49-
- 8080:8080
5074
steps:
5175
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
52-
- uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1
76+
- uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3
5377
with:
54-
node-version: 12
78+
node-version: 'lts/*'
5579
registry-url: https://registry.npmjs.org/
80+
cache: 'npm'
5681
- run: npm ci
57-
- run: APIURL=http://127.0.0.1:8080/1 npm run integration
82+
- run: npm run coverage
5883
format:
5984
runs-on: ubuntu-latest
6085
steps:
6186
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
62-
- uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1
87+
- uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3
6388
with:
64-
node-version: 12
89+
node-version: 'lts/*'
6590
registry-url: https://registry.npmjs.org/
91+
cache: 'npm'
6692
- run: npm ci
6793
- run: npm run format:ci
6894
gitdiff:
6995
runs-on: ubuntu-latest
7096
steps:
7197
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
72-
- uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1
98+
- uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3
7399
with:
74-
node-version: 12
100+
node-version: 'lts/*'
75101
registry-url: https://registry.npmjs.org/
102+
cache: 'npm'
76103
- run: npm ci
77104
- run: npm run gitdiff:ci
78105
lint:
79106
runs-on: ubuntu-latest
80107
steps:
81108
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
82-
- uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1
109+
- uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3
83110
with:
84-
node-version: 12
111+
node-version: 'lts/*'
85112
registry-url: https://registry.npmjs.org/
113+
cache: 'npm'
86114
- run: npm ci
87115
- run: npm run lint
88116
lint-tests:
89117
runs-on: ubuntu-latest
90118
steps:
91119
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
92-
- uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1
120+
- uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3
93121
with:
94-
node-version: 12
122+
node-version: 'lts/*'
95123
registry-url: https://registry.npmjs.org/
124+
cache: 'npm'
96125
- run: npm ci
97126
- run: npm run lint:tests

.npm-audit-whitelister.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

.nsprc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)