Skip to content

Commit

Permalink
feat: combine lint and test workflows and clean them up (#2261)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
reconbot authored Jun 9, 2021
1 parent 2cd5648 commit 0461285
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 102 deletions.
25 changes: 6 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,17 @@ jobs:
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
node-version: [14.x]
config:
# arch isn't used and we have no way to use it currently
- { os: macos-latest, arch: x64 }
- { os: ubuntu-latest, arch: x64 }
- { os: windows-latest, arch: x64 }
- { os: windows-latest, arch: ia32 }
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
# https://github.com/nodejs/node-gyp/issues/1663#issuecomment-535049449
- name: patch node gyp on windows to support Visual Studio 2019
if: matrix.os == 'windows-latest'
shell: powershell
run: |
npm install --global node-gyp@latest
npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}
- name: upgrade npm
run: npm install -g npm
- name: npm install
run: npm install
- name: npm run prebuild
run: npm run prebuild
node-version: 14.x
- run: npm ci
- run: npm run prebuild
env:
prebuild_upload: ${{ secrets.GITHUB_TOKEN }}
22 changes: 0 additions & 22 deletions .github/workflows/lint.yml

This file was deleted.

45 changes: 11 additions & 34 deletions .github/workflows/test-merge.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,24 @@
name: Test Merge
on:
push:
branches:
- '**'
- '!master'
# pull_request:
# types: [opened, synchronize]
name: Test Merge Commit
on: pull_request

jobs:
test-merge:
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
# chances are that we'll never break on a merge to master on just one version of node
node-version: [14.x]
config:
# arch isn't used and we have no way to use it currently
- { os: macos-latest, arch: x64 }
- { os: ubuntu-latest, arch: x64 }
- { os: windows-latest, arch: x64 }
- { os: windows-latest, arch: ia32 }
steps:
- uses: actions/checkout@v1
- name: merge master
run: git merge origin/master
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
# https://github.com/nodejs/node-gyp/issues/1663#issuecomment-535049449
- name: patch node gyp on windows to support Visual Studio 2019
if: matrix.os == 'windows-latest'
shell: powershell
run: |
npm install --global node-gyp@latest
npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}
- name: upgrade npm
run: npm install -g npm
- name: npm install
run: npm install
- name: npm run rebuild
run: npm run rebuild
- name: npm test
run: npm test
- name: coverage
run: npm run coverage
node-version: 14
- run: npm ci
- run: npm run rebuild
- run: npm test
- run: npm run coverage
env:
CI: true
45 changes: 18 additions & 27 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,34 @@
name: Test
name: Test / Lint
on:
push:
branches:
- '**'
# pull_request:
# types: [opened, synchronize]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
- run: npm ci
- run: npm run lint
test:
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
node-version: [10.x, 12.x, 14.x, 16.x]
config:
# arch isn't used and we have no way to use it currently
- { os: macos-latest, arch: x64 }
- { os: ubuntu-latest, arch: x64 }
- { os: windows-latest, arch: x64 }
- { os: windows-latest, arch: ia32 }
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
# https://github.com/nodejs/node-gyp/issues/1663#issuecomment-535049449
- name: patch node gyp on windows to support Visual Studio 2019
if: matrix.os == 'windows-latest'
shell: powershell
run: |
npm install --global node-gyp@latest
npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}
- name: upgrade npm
run: npm install -g npm
- name: npm install
run: npm install
- name: npm run rebuild
run: npm run rebuild
- name: npm test
run: npm test
- name: coverage
run: npm run coverage
- run: npm ci
- run: npm run rebuild
- run: npm test
- run: npm run coverage
env:
CI: true

0 comments on commit 0461285

Please sign in to comment.