Combine basic jobs to reduce Actions usage

This commit is contained in:
Henry Mercer
2025-08-21 13:55:22 +01:00
parent 06f83b7cc8
commit 3edad3eebd

View File

@@ -9,20 +9,41 @@ on:
workflow_dispatch:
jobs:
check-js:
name: Check JS
runs-on: ubuntu-latest
timeout-minutes: 45
unit-tests:
name: Unit Tests
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
permissions:
contents: read
security-events: write # needed to upload ESLint results
runs-on: ${{ matrix.os }}
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v5
- uses: actions/checkout@v5
- name: Install dependencies
run: npm install
run: |
# Use the system Bash shell to ensure we can run commands like `npm install`
# that are not available in the default shell on Windows.
npm config set script-shell bash
npm install
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Verify compiled JS up to date
run: .github/workflows/script/check-js.sh
- name: Verify PR checks up to date
run: .github/workflows/script/verify-pr-checks.sh
- name: Run unit tests
run: npm test
- name: Lint
id: lint
@@ -30,54 +51,11 @@ jobs:
- name: Upload sarif
uses: github/codeql-action/upload-sarif@v3
if: matrix.os == 'ubuntu-latest'
with:
sarif_file: eslint.sarif
category: eslint
- name: Check generated JS
run: .github/workflows/script/check-js.sh
check-file-contents:
name: Check file contents
permissions:
contents: read
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
# Ensure the generated PR check workflows are up to date.
- name: Verify PR checks up to date
run: .github/workflows/script/verify-pr-checks.sh
npm-test:
name: Unit Test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
permissions:
contents: read
runs-on: ${{ matrix.os }}
timeout-minutes: 45
steps:
- uses: actions/checkout@v5
- name: npm test
run: |
# Run any commands referenced in package.json using Bash, otherwise
# we won't be able to find them on Windows.
npm config set script-shell bash
npm install
npm test
check-node-version:
if: github.event.pull_request
name: Check Action Node versions