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 Apr 19, 2021
1 parent eccda6b commit 6d09911
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 39 deletions.
3 changes: 0 additions & 3 deletions .eslintignore
@@ -1,4 +1 @@
coverage/

# until eslint can parse `import.meta.url`
test/node.mjs
37 changes: 28 additions & 9 deletions .github/workflows/node-4+.yml
Expand Up @@ -7,35 +7,54 @@ jobs:
runs-on: ubuntu-latest
outputs:
latest: ${{ steps.set-matrix.outputs.requireds }}
minors: ${{ steps.set-matrix.outputs.optionals }}
steps:
- uses: ljharb/actions/node/matrix@main
id: set-matrix
with:
preset: '>=4'
type: 'majors'
envs: "[{ \"TEST_VARIANT\": \"es6-shim\" }, { \"TEST_VARIANT\": \"es6-shim\", \"PRELOAD_GET_ITERATOR\": true }, { \"TEST_VARIANT\": \"core-js\", \"CORE_JS\": 2 }, { \"TEST_VARIANT\": \"core-js\", \"CORE_JS\": 3 }]"

latest:
needs: [matrix]
name: 'latest minors'
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.latest) }}

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run tests-only'
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
shell-command: 'TEST_VARIANT=${{ matrix.envs.TEST_VARIANT }} npm run tests-only'
after_install: '[ -z "${{ matrix.envs.CORE_JS }}" ] || npm install core-js@${{ matrix.envs.CORE_JS }}'


- run: npm run tests-only
- uses: codecov/codecov-action@v1

minors:
needs: [matrix, latest]
name: 'non-latest minors'
continue-on-error: true
if: ${{ !github.head_ref || !startsWith(github.head_ref, 'renovate') }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.minors) }}

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

node:
name: 'node 4+'
needs: [latest]
needs: [latest, minors]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'
10 changes: 7 additions & 3 deletions .github/workflows/node-esm.yml
Expand Up @@ -8,6 +8,7 @@ jobs:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- node-version: '13.7'
Expand Down Expand Up @@ -52,11 +53,14 @@ jobs:

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

node:
name: 'node, notable ESM minors'
Expand Down
36 changes: 29 additions & 7 deletions .github/workflows/node-iojs.yml
Expand Up @@ -7,34 +7,56 @@ jobs:
runs-on: ubuntu-latest
outputs:
latest: ${{ steps.set-matrix.outputs.requireds }}
minors: ${{ steps.set-matrix.outputs.optionals }}
steps:
- uses: ljharb/actions/node/matrix@main
id: set-matrix
with:
preset: 'iojs'
type: 'majors'
envs: "[{ \"TEST_VARIANT\": \"es6-shim\" }, { \"TEST_VARIANT\": \"es6-shim\", \"PRELOAD_GET_ITERATOR\": true }, { \"TEST_VARIANT\": \"core-js\", \"CORE_JS\": 2 }, { \"TEST_VARIANT\": \"core-js\", \"CORE_JS\": 3 }]"

latest:
needs: [matrix]
name: 'latest minors'
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.latest) }}

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run tests-only'
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
shell-command: 'TEST_VARIANT=${{ matrix.envs.TEST_VARIANT }} npm run tests-only'
after_install: '[ -z "${{ matrix.envs.CORE_JS }}" ] || npm install core-js@${{ matrix.envs.CORE_JS }}'
skip-ls-check: true
- run: npm run tests-only
- uses: codecov/codecov-action@v1

minors:
needs: [matrix, latest]
name: 'non-latest minors'
continue-on-error: true
if: ${{ !github.head_ref || !startsWith(github.head_ref, 'renovate') }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.minors) }}

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

node:
name: 'io.js'
needs: [latest]
needs: [latest, minors]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'
12 changes: 6 additions & 6 deletions .github/workflows/node-pretest.yml
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
17 changes: 10 additions & 7 deletions .github/workflows/node-zero.yml
Expand Up @@ -13,25 +13,26 @@ jobs:
id: set-matrix
with:
preset: '0.x'
envs: "[{ \"TEST_VARIANT\": \"es6-shim\" }, { \"TEST_VARIANT\": \"es6-shim\", \"PRELOAD_GET_ITERATOR\": true }, { \"TEST_VARIANT\": \"core-js\", \"CORE_JS\": 2 }, { \"TEST_VARIANT\": \"core-js\", \"CORE_JS\": 3 }]"

stable:
needs: [matrix]
name: 'stable minors'
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.stable) }}

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/run@main
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
shell-command: 'TEST_VARIANT=${{ matrix.envs.TEST_VARIANT }} npm run tests-only'
after_install: '[ -z "${{ matrix.envs.CORE_JS }}" ] || npm install core-js@${{ matrix.envs.CORE_JS }}'
cache-node-modules-key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }}
skip-ls-check: true
- run: npm run tests-only
- uses: codecov/codecov-action@v1

unstable:
needs: [matrix, stable]
Expand All @@ -41,17 +42,19 @@ jobs:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.unstable) }}

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/run@main
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
shell-command: 'TEST_VARIANT=${{ matrix.envs.TEST_VARIANT }} npm run tests-only'
after_install: '[ -z "${{ matrix.envs.CORE_JS }}" ] || npm install core-js@${{ matrix.envs.CORE_JS }}'
cache-node-modules-key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }}
skip-ls-check: true
- run: npm run tests-only
- uses: codecov/codecov-action@v1

node:
name: 'node 0.x'
Expand Down
4 changes: 0 additions & 4 deletions .nycrc
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 6d09911

Please sign in to comment.