Skip to content

Commit 0461285

Browse files
authored
feat: combine lint and test workflows and clean them up (#2261)
- lint job is now part of the test workflow - test merge and test jobs are now easier to understand and no longer work around fixed bugs - test merge now runs on a pr event which should be a merge commit - everything should be faster
1 parent 2cd5648 commit 0461285

File tree

4 files changed

+35
-102
lines changed

4 files changed

+35
-102
lines changed

.github/workflows/build.yml

+6-19
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,17 @@ jobs:
99
runs-on: ${{ matrix.config.os }}
1010
strategy:
1111
matrix:
12-
node-version: [14.x]
1312
config:
13+
# arch isn't used and we have no way to use it currently
1414
- { os: macos-latest, arch: x64 }
1515
- { os: ubuntu-latest, arch: x64 }
1616
- { os: windows-latest, arch: x64 }
17-
- { os: windows-latest, arch: ia32 }
1817
steps:
19-
- uses: actions/checkout@v1
20-
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v1
18+
- uses: actions/checkout@v2
19+
- uses: actions/setup-node@v2
2220
with:
23-
node-version: ${{ matrix.node-version }}
24-
# https://github.com/nodejs/node-gyp/issues/1663#issuecomment-535049449
25-
- name: patch node gyp on windows to support Visual Studio 2019
26-
if: matrix.os == 'windows-latest'
27-
shell: powershell
28-
run: |
29-
npm install --global node-gyp@latest
30-
npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}
31-
- name: upgrade npm
32-
run: npm install -g npm
33-
- name: npm install
34-
run: npm install
35-
- name: npm run prebuild
36-
run: npm run prebuild
21+
node-version: 14.x
22+
- run: npm ci
23+
- run: npm run prebuild
3724
env:
3825
prebuild_upload: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint.yml

-22
This file was deleted.

.github/workflows/test-merge.yml

+11-34
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,24 @@
1-
name: Test Merge
2-
on:
3-
push:
4-
branches:
5-
- '**'
6-
- '!master'
7-
# pull_request:
8-
# types: [opened, synchronize]
1+
name: Test Merge Commit
2+
on: pull_request
3+
94
jobs:
105
test-merge:
116
runs-on: ${{ matrix.config.os }}
127
strategy:
138
matrix:
14-
# chances are that we'll never break on a merge to master on just one version of node
15-
node-version: [14.x]
169
config:
10+
# arch isn't used and we have no way to use it currently
1711
- { os: macos-latest, arch: x64 }
1812
- { os: ubuntu-latest, arch: x64 }
1913
- { os: windows-latest, arch: x64 }
20-
- { os: windows-latest, arch: ia32 }
2114
steps:
22-
- uses: actions/checkout@v1
23-
- name: merge master
24-
run: git merge origin/master
25-
- name: Use Node.js ${{ matrix.node-version }}
26-
uses: actions/setup-node@v1
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-node@v2
2717
with:
28-
node-version: ${{ matrix.node-version }}
29-
# https://github.com/nodejs/node-gyp/issues/1663#issuecomment-535049449
30-
- name: patch node gyp on windows to support Visual Studio 2019
31-
if: matrix.os == 'windows-latest'
32-
shell: powershell
33-
run: |
34-
npm install --global node-gyp@latest
35-
npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}
36-
- name: upgrade npm
37-
run: npm install -g npm
38-
- name: npm install
39-
run: npm install
40-
- name: npm run rebuild
41-
run: npm run rebuild
42-
- name: npm test
43-
run: npm test
44-
- name: coverage
45-
run: npm run coverage
18+
node-version: 14
19+
- run: npm ci
20+
- run: npm run rebuild
21+
- run: npm test
22+
- run: npm run coverage
4623
env:
4724
CI: true

.github/workflows/test.yml

+18-27
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,34 @@
1-
name: Test
1+
name: Test / Lint
22
on:
33
push:
4-
branches:
5-
- '**'
6-
# pull_request:
7-
# types: [opened, synchronize]
84
jobs:
5+
lint:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- uses: actions/setup-node@v2
10+
with:
11+
node-version: 14
12+
- run: npm ci
13+
- run: npm run lint
914
test:
1015
runs-on: ${{ matrix.config.os }}
1116
strategy:
1217
matrix:
13-
node-version: [10.x, 12.x, 14.x]
18+
node-version: [10.x, 12.x, 14.x, 16.x]
1419
config:
20+
# arch isn't used and we have no way to use it currently
1521
- { os: macos-latest, arch: x64 }
1622
- { os: ubuntu-latest, arch: x64 }
1723
- { os: windows-latest, arch: x64 }
18-
- { os: windows-latest, arch: ia32 }
1924
steps:
20-
- uses: actions/checkout@v1
21-
- name: Use Node.js ${{ matrix.node-version }}
22-
uses: actions/setup-node@v1
25+
- uses: actions/checkout@v2
26+
- uses: actions/setup-node@v2
2327
with:
2428
node-version: ${{ matrix.node-version }}
25-
# https://github.com/nodejs/node-gyp/issues/1663#issuecomment-535049449
26-
- name: patch node gyp on windows to support Visual Studio 2019
27-
if: matrix.os == 'windows-latest'
28-
shell: powershell
29-
run: |
30-
npm install --global node-gyp@latest
31-
npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}
32-
- name: upgrade npm
33-
run: npm install -g npm
34-
- name: npm install
35-
run: npm install
36-
- name: npm run rebuild
37-
run: npm run rebuild
38-
- name: npm test
39-
run: npm test
40-
- name: coverage
41-
run: npm run coverage
29+
- run: npm ci
30+
- run: npm run rebuild
31+
- run: npm test
32+
- run: npm run coverage
4233
env:
4334
CI: true

0 commit comments

Comments
 (0)