Skip to content

Commit

Permalink
[actions] use node/install instead of node/run; use codecov action
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed May 8, 2021
1 parent b4f7636 commit 304af52
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 28 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/node-4+.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
command:
Expand All @@ -29,11 +30,13 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run ${{ matrix.command }}'
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
command: ${{ matrix.command }}
- run: npm run ${{ matrix.command }}
- uses: codecov/codecov-action@v1

minors:
needs: [matrix, latest]
name: 'non-latest minors'
Expand All @@ -42,18 +45,20 @@ jobs:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.minors) }}
command:
- 'tests-only'

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run ${{ matrix.command }}'
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
command: ${{ matrix.command }}
- run: npm run ${{ matrix.command }}
- uses: codecov/codecov-action@v1

node:
name: 'node 4+'
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/node-iojs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
command:
Expand All @@ -30,12 +31,13 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run ${{ matrix.command }}'
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
command: ${{ matrix.command }}
skip-ls-check: true
- run: npm run ${{ matrix.command }}
- uses: codecov/codecov-action@v1

minors:
needs: [matrix, latest]
Expand All @@ -45,6 +47,7 @@ jobs:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.minors) }}
command:
Expand All @@ -54,12 +57,13 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run ${{ matrix.command }}'
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
command: ${{ matrix.command }}
skip-ls-check: true
- run: npm run ${{ matrix.command }}
- uses: codecov/codecov-action@v1

node:
name: 'io.js'
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/node-pretest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run pretest'
- uses: ljharb/actions/node/install@main
name: 'nvm install lts/* && npm install'
with:
node-version: 'lts/*'
command: 'pretest'
- run: npm run pretest

posttest:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run posttest'
- uses: ljharb/actions/node/install@main
name: 'nvm install lts/* && npm install'
with:
node-version: 'lts/*'
command: 'posttest'
- run: npm run posttest
16 changes: 10 additions & 6 deletions .github/workflows/node-zero.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.stable) }}
command:
Expand All @@ -30,13 +31,14 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run ${{ matrix.command }}'
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
command: ${{ matrix.command }}
cache-node-modules-key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }}
skip-ls-check: true
- run: npm run ${{ matrix.command }}
- uses: codecov/codecov-action@v1

unstable:
needs: [matrix, stable]
Expand All @@ -46,6 +48,7 @@ jobs:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.unstable) }}
command:
Expand All @@ -55,13 +58,14 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run ${{ matrix.command }}'
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
command: ${{ matrix.command }}
cache-node-modules-key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }}
skip-ls-check: true
- run: npm run ${{ matrix.command }}
- uses: codecov/codecov-action@v1

node:
name: 'node 0.x'
Expand Down
4 changes: 0 additions & 4 deletions .nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"lines": 86,
"statements": 85.93,
"functions": 82.43,
"branches": 76.06,
"exclude": [
"coverage",
"test"
Expand Down

0 comments on commit 304af52

Please sign in to comment.