Fix GitHub actions to work a little better

This commit is contained in:
Claudia Meadows 2024-09-02 10:12:15 -07:00
parent a4db1a1116
commit 57c331c6b4
No known key found for this signature in database
GPG key ID: C86B594396786760
9 changed files with 102 additions and 70 deletions

38
.github/workflows/_npm-task.yml vendored Normal file
View file

@ -0,0 +1,38 @@
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
- windows-latest
- macos-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 }}