Skip to content

Commit 3edad3e

Browse files
committed
Combine basic jobs to reduce Actions usage
1 parent 06f83b7 commit 3edad3e

File tree

1 file changed

+30
-52
lines changed

1 file changed

+30
-52
lines changed

.github/workflows/pr-checks.yml

Lines changed: 30 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -9,74 +9,52 @@ on:
99
workflow_dispatch:
1010

1111
jobs:
12-
check-js:
13-
name: Check JS
14-
runs-on: ubuntu-latest
15-
timeout-minutes: 45
12+
unit-tests:
13+
name: Unit Tests
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest, macos-latest, windows-latest]
1618
permissions:
1719
contents: read
1820
security-events: write # needed to upload ESLint results
19-
20-
steps:
21-
- name: Checkout
22-
uses: actions/checkout@v5
23-
24-
- name: Install dependencies
25-
run: npm install
26-
27-
- name: Lint
28-
id: lint
29-
run: npm run lint-ci
30-
31-
- name: Upload sarif
32-
uses: github/codeql-action/upload-sarif@v3
33-
with:
34-
sarif_file: eslint.sarif
35-
category: eslint
36-
37-
- name: Check generated JS
38-
run: .github/workflows/script/check-js.sh
39-
40-
check-file-contents:
41-
name: Check file contents
42-
permissions:
43-
contents: read
44-
runs-on: ubuntu-latest
21+
runs-on: ${{ matrix.os }}
4522
timeout-minutes: 45
4623

4724
steps:
48-
- name: Checkout
49-
uses: actions/checkout@v5
25+
- uses: actions/checkout@v5
26+
27+
- name: Install dependencies
28+
run: |
29+
# Use the system Bash shell to ensure we can run commands like `npm install`
30+
# that are not available in the default shell on Windows.
31+
npm config set script-shell bash
32+
npm install
5033
5134
- name: Set up Python
5235
uses: actions/setup-python@v5
5336
with:
5437
python-version: 3.11
5538

56-
# Ensure the generated PR check workflows are up to date.
39+
- name: Verify compiled JS up to date
40+
run: .github/workflows/script/check-js.sh
41+
5742
- name: Verify PR checks up to date
5843
run: .github/workflows/script/verify-pr-checks.sh
5944

60-
npm-test:
61-
name: Unit Test
62-
strategy:
63-
fail-fast: false
64-
matrix:
65-
os: [ubuntu-latest, macos-latest, windows-latest]
66-
permissions:
67-
contents: read
68-
runs-on: ${{ matrix.os }}
69-
timeout-minutes: 45
45+
- name: Run unit tests
46+
run: npm test
7047

71-
steps:
72-
- uses: actions/checkout@v5
73-
- name: npm test
74-
run: |
75-
# Run any commands referenced in package.json using Bash, otherwise
76-
# we won't be able to find them on Windows.
77-
npm config set script-shell bash
78-
npm install
79-
npm test
48+
- name: Lint
49+
id: lint
50+
run: npm run lint-ci
51+
52+
- name: Upload sarif
53+
uses: github/codeql-action/upload-sarif@v3
54+
if: matrix.os == 'ubuntu-latest'
55+
with:
56+
sarif_file: eslint.sarif
57+
category: eslint
8058

8159
check-node-version:
8260
if: github.event.pull_request

0 commit comments

Comments
 (0)