From 3edad3eebd6f0cc8ec9eeae4051e359fe42f9639 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Thu, 21 Aug 2025 13:55:22 +0100 Subject: [PATCH] Combine basic jobs to reduce Actions usage --- .github/workflows/pr-checks.yml | 82 ++++++++++++--------------------- 1 file changed, 30 insertions(+), 52 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 6783080d5..c32d05edc 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -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