Skip to content

Commit

Permalink
[actions] reuse common workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 10, 2021
1 parent 86e6e3a commit 95ea6c0
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 269 deletions.
60 changes: 0 additions & 60 deletions .github/workflows/node-4+.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/node-aught.yml
@@ -0,0 +1,18 @@
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

node:
name: 'node < 10'
needs: [tests]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'
64 changes: 7 additions & 57 deletions .github/workflows/node-harmony.yml
Expand Up @@ -3,66 +3,16 @@ name: 'Tests: node.js (harmony)'
on: [pull_request, push]

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
stable: ${{ steps.set-matrix.outputs.requireds }}
unstable: ${{ steps.set-matrix.outputs.optionals }}
steps:
- uses: ljharb/actions/node/matrix@main
id: set-matrix
with:
versionsAsRoot: true
preset: '>=0.4 <16'

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

strategy:
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.stable) }}

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 }}
cache-node-modules-key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }}
skip-ls-check: true
- run: npm run test:harmony
- uses: codecov/codecov-action@v2

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

strategy:
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.unstable) }}
exclude:
- node-version: 0.7
- node-version: 0.4

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 }}
cache-node-modules-key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }}
skip-ls-check: true
- run: npm run test:harmony
- uses: codecov/codecov-action@v2
tests:
uses: ljharb/actions/.github/workflows/node.yml@main
with:
range: '>=0.4 <16'
type: minors
command: npm run test:harmony

node:
name: 'node: harmony'
needs: [stable, unstable]
needs: [tests]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'
62 changes: 0 additions & 62 deletions .github/workflows/node-iojs.yml

This file was deleted.

23 changes: 2 additions & 21 deletions .github/workflows/node-pretest.yml
Expand Up @@ -3,24 +3,5 @@ name: 'Tests: pretest/posttest'
on: [pull_request, push]

jobs:
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
18 changes: 18 additions & 0 deletions .github/workflows/node-tens.yml
@@ -0,0 +1,18 @@
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

node:
name: 'node >= 10'
needs: [tests]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'
64 changes: 0 additions & 64 deletions .github/workflows/node-zero.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/rebase.yml
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: ljharb/rebase@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
- uses: ljharb/rebase@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/require-allow-edits.yml
Expand Up @@ -9,4 +9,4 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: ljharb/require-allow-edits@main
- uses: ljharb/require-allow-edits@main

0 comments on commit 95ea6c0

Please sign in to comment.