Simplify the test flow, drop EOL'd Node version
This commit is contained in:
parent
9d7cf4d474
commit
745dfb614a
2 changed files with 21 additions and 53 deletions
35
.github/workflows/_npm-task.yml
vendored
35
.github/workflows/_npm-task.yml
vendored
|
|
@ -1,35 +0,0 @@
|
|||
name: Run npm task
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
task:
|
||||
type: string
|
||||
required: true
|
||||
node-version:
|
||||
type: number
|
||||
default: 20
|
||||
continue-on-error:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
# This uses actions/checkout instead of `git clone` directly since it's way
|
||||
# easier than parsing everything out.
|
||||
|
||||
jobs:
|
||||
run-task:
|
||||
name: npm run ${{ inputs.task }}
|
||||
continue-on-error: ${{ inputs.continue-on-error }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
- run: npm ci
|
||||
- run: npm run ${{ inputs.task }}
|
||||
39
.github/workflows/test.yml
vendored
39
.github/workflows/test.yml
vendored
|
|
@ -10,32 +10,35 @@ permissions:
|
|||
actions: write
|
||||
contents: read
|
||||
|
||||
# This uses actions/checkout instead of `git clone` directly since it's way
|
||||
# easier than parsing everything out.
|
||||
|
||||
jobs:
|
||||
lint-js:
|
||||
uses: ./.github/workflows/_npm-task.yml
|
||||
with:
|
||||
task: lint:js
|
||||
|
||||
build-js:
|
||||
needs: lint-js
|
||||
uses: ./.github/workflows/_npm-task.yml
|
||||
with:
|
||||
task: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
||||
- run: npm run build
|
||||
|
||||
test-js:
|
||||
needs: build-js
|
||||
needs: lint-js
|
||||
strategy:
|
||||
matrix:
|
||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||
node-version:
|
||||
- 16
|
||||
- 18
|
||||
- 20
|
||||
- 22
|
||||
uses: ./.github/workflows/_npm-task.yml
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
task: test:js
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: npm ci-test
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue