Skip to content

Commit

Permalink
[actions] use reusable workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Sep 6, 2023
1 parent 35ce967 commit b3d4f1d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 93 deletions.
41 changes: 6 additions & 35 deletions .github/workflows/node-aught.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,16 @@ name: 'Tests: node.js < 10'
on: [pull_request, push]

jobs:
# tests:
# uses: ljharb/actions/.github/workflows/node.yml@main
# with:
# range: '< 10'
# type: minors
# command: npm run tests-only

matrix:
runs-on: ubuntu-latest
outputs:
latest: ${{ steps.set-matrix.outputs.requireds }}
steps:
- uses: ljharb/actions/node/matrix@main
id: set-matrix
with:
type: 'minors'
preset: '< 10'

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

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

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@v2
uses: ljharb/actions/.github/workflows/node.yml@main
with:
range: '< 10'
type: minors
command: npm run tests-only

node:
name: 'node < 10'
needs: [tests]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'
- run: 'echo tests completed'
26 changes: 2 additions & 24 deletions .github/workflows/node-pretest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,5 @@ name: 'Tests: pretest/posttest'
on: [pull_request, push]

jobs:
# tests:
# uses: ljharb/actions/.github/workflows/pretest.yml@main

pretest:
runs-on: ubuntu-latest

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

posttest:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install lts/* && npm install'
with:
node-version: 'lts/*'
- run: npm run posttest
tests:
uses: ljharb/actions/.github/workflows/pretest.yml@main
39 changes: 5 additions & 34 deletions .github/workflows/node-tens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,12 @@ name: 'Tests: node.js >= 10'
on: [pull_request, push]

jobs:
# tests:
# uses: ljharb/actions/.github/workflows/node.yml@main
# with:
# range: '>= 10'
# type: minors
# command: npm run tests-only

matrix:
runs-on: ubuntu-latest
outputs:
latest: ${{ steps.set-matrix.outputs.requireds }}
steps:
- uses: ljharb/actions/node/matrix@main
id: set-matrix
with:
type: 'minors'
preset: '>= 10'

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

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

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@v2
uses: ljharb/actions/.github/workflows/node.yml@main
with:
range: '>= 10'
type: minors
command: npm run tests-only

node:
name: 'node >= 10'
Expand Down

0 comments on commit b3d4f1d

Please sign in to comment.