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
|
actions: write
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
# This uses actions/checkout instead of `git clone` directly since it's way
|
|
||||||
# easier than parsing everything out.
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint-js:
|
lint-js:
|
||||||
uses: ./.github/workflows/_npm-task.yml
|
runs-on: ubuntu-latest
|
||||||
with:
|
steps:
|
||||||
task: lint:js
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
build-js:
|
fetch-depth: 1
|
||||||
needs: lint-js
|
- uses: actions/setup-node@v4
|
||||||
uses: ./.github/workflows/_npm-task.yml
|
with:
|
||||||
with:
|
node-version: 20
|
||||||
task: build
|
- run: npm ci
|
||||||
|
- run: npm run lint
|
||||||
|
- run: npm run build
|
||||||
|
|
||||||
test-js:
|
test-js:
|
||||||
needs: build-js
|
needs: lint-js
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||||
node-version:
|
node-version:
|
||||||
- 16
|
|
||||||
- 18
|
- 18
|
||||||
- 20
|
- 20
|
||||||
- 22
|
- 22
|
||||||
uses: ./.github/workflows/_npm-task.yml
|
runs-on: ubuntu-latest
|
||||||
with:
|
steps:
|
||||||
node-version: ${{ matrix.node-version }}
|
- uses: actions/checkout@v4
|
||||||
task: test:js
|
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