Skip to content

Commit f3fe52b

Browse files
authored
Faster CodeQL (#1944)
1 parent 9c48738 commit f3fe52b

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/codeql.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- main
77
- release/*
88
pull_request:
9+
branches:
10+
- main
11+
- release/*
912
# TODO (trask) adding this to the merge queue causes the merge queue to fail
1013
# see related issues
1114
# - https://github.com/github/codeql-action/issues/1572
@@ -20,36 +23,48 @@ permissions:
2023

2124
jobs:
2225
analyze:
26+
name: Analyze (${{ matrix.language }})
2327
permissions:
2428
contents: read
2529
actions: read # for github/codeql-action/init to get workflow details
2630
security-events: write # for github/codeql-action/analyze to upload SARIF results
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
include:
35+
- language: actions
36+
- language: java
2737
runs-on: ubuntu-latest
2838
steps:
2939
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3040

3141
- name: Set up Java 17
42+
if: matrix.language == 'java'
3243
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
3344
with:
3445
distribution: temurin
3546
java-version: 17
3647

3748
- name: Set up gradle
49+
if: matrix.language == 'java'
3850
uses: gradle/actions/setup-gradle@8379f6a1328ee0e06e2bb424dadb7b159856a326 # v4.4.0
3951

4052
- name: Initialize CodeQL
4153
uses: github/codeql-action/init@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
4254
with:
43-
languages: java, actions
55+
languages: ${{ matrix.language }}
4456
# using "latest" helps to keep up with the latest Kotlin support
4557
# see https://github.com/github/codeql-action/issues/1555#issuecomment-1452228433
4658
tools: latest
4759

4860
- name: Assemble
61+
if: matrix.language == 'java'
4962
# --no-build-cache is required for codeql to analyze all modules
5063
# --no-daemon is required for codeql to observe the compilation
5164
# (see https://docs.github.com/en/code-security/codeql-cli/getting-started-with-the-codeql-cli/preparing-your-code-for-codeql-analysis#specifying-build-commands)
5265
run: ./gradlew assemble --no-build-cache --no-daemon
5366

5467
- name: Perform CodeQL analysis
5568
uses: github/codeql-action/analyze@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
69+
with:
70+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)