Skip to content

Commit 57b1d5a

Browse files
committed
chore(workflow): split codeql into its own job
1 parent 18797ca commit 57b1d5a

1 file changed

Lines changed: 39 additions & 16 deletions

File tree

.github/workflows/ci.yml

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,54 @@ on:
2525
branches:
2626
- '*'
2727

28-
permissions:
29-
contents: read
30-
security-events: write
31-
3228
jobs:
29+
codeql:
30+
name: CodeQL Analysis
31+
runs-on: ubuntu-latest
32+
33+
permissions:
34+
contents: read
35+
security-events: write
36+
37+
steps:
38+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
39+
with:
40+
persist-credentials: false
41+
fetch-depth: 1
42+
43+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
44+
with:
45+
node-version: 24.x
46+
47+
- uses: github/codeql-action/init@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
48+
with:
49+
languages: javascript
50+
queries: security-and-quality
51+
config: |
52+
paths-ignore:
53+
- coverage
54+
- node_modules
55+
56+
- name: Run npm install
57+
run: npm ci
58+
env:
59+
CI: true
60+
61+
- uses: github/codeql-action/analyze@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
62+
3363
test:
3464
name: NodeJS ${{ matrix.node-version }} on ${{ matrix.os }}
3565
runs-on: ${{ matrix.os }}
3666

67+
permissions:
68+
contents: read
69+
3770
strategy:
3871
matrix:
3972
node-version: [20.x, 22.x, 24.x]
4073
os: [ubuntu-latest, macos-26]
41-
node-options: '--test-coverage-exclude="test/**/*.js"' # shared default node options
74+
# Shared default node options
75+
node-options: '--test-coverage-exclude="test/**/*.js"'
4276

4377
include:
4478
# Override default node options for node 20.x
@@ -61,23 +95,12 @@ jobs:
6195
node --version
6296
npm --version
6397
64-
- uses: github/codeql-action/init@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
65-
with:
66-
languages: javascript
67-
queries: security-and-quality
68-
config: |
69-
paths-ignore:
70-
- coverage
71-
- node_modules
72-
7398
- name: npm install and test
7499
run: npm cit
75100
env:
76101
CI: true
77102
NODE_OPTIONS: ${{ matrix.node-options }}
78103

79-
- uses: github/codeql-action/analyze@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
80-
81104
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
82105
if: success()
83106
with:

0 commit comments

Comments
 (0)