|
9 | 9 | workflow_dispatch: |
10 | 10 |
|
11 | 11 | 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] |
16 | 18 | permissions: |
17 | 19 | contents: read |
18 | 20 | 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 }} |
45 | 22 | timeout-minutes: 45 |
46 | 23 |
|
47 | 24 | 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 |
50 | 33 |
|
51 | 34 | - name: Set up Python |
52 | 35 | uses: actions/setup-python@v5 |
53 | 36 | with: |
54 | 37 | python-version: 3.11 |
55 | 38 |
|
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 | + |
57 | 42 | - name: Verify PR checks up to date |
58 | 43 | run: .github/workflows/script/verify-pr-checks.sh |
59 | 44 |
|
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 |
70 | 47 |
|
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 |
80 | 58 |
|
81 | 59 | check-node-version: |
82 | 60 | if: github.event.pull_request |
|
0 commit comments