Skip to content

Commit 25120b7

Browse files
committed
Fix codeql ci
1 parent 21230a1 commit 25120b7

1 file changed

Lines changed: 47 additions & 7 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,62 @@
11
name: CodeQL
22

33
on:
4-
push: { branches: [ master, main ] }
5-
pull_request: { branches: [ master, main ] }
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
68
schedule:
79
- cron: "0 6 * * 1"
810
workflow_dispatch:
911

12+
permissions:
13+
actions: read
14+
contents: read
15+
security-events: write
16+
17+
env:
18+
JAVA_VERSION: "17"
19+
SCALA_VERSION: "2.13.14"
20+
SPARK_VERSION: "3.5.1"
21+
1022
jobs:
1123
analyze:
1224
runs-on: ubuntu-latest
13-
permissions:
14-
security-events: write
15-
actions: read
16-
contents: read
1725
steps:
1826
- uses: actions/checkout@v4
27+
28+
- uses: actions/setup-java@v4
29+
with:
30+
distribution: temurin
31+
java-version: ${{ env.JAVA_VERSION }}
32+
33+
- uses: sbt/setup-sbt@v1
34+
35+
# Cache speeds up dependency resolution so CodeQL has more time to analyze.
36+
- name: Cache Ivy / Coursier / SBT
37+
uses: actions/cache@v4
38+
with:
39+
path: |
40+
~/.ivy2/cache
41+
~/.sbt
42+
~/.cache/coursier
43+
key: ${{ runner.os }}-codeql-${{ hashFiles('**/*.sbt', 'project/**') }}
44+
restore-keys: |
45+
${{ runner.os }}-codeql-
46+
47+
# Initialize CodeQL for the JVM extractor (covers Java/Kotlin/Scala bytecode)
1948
- uses: github/codeql-action/init@v3
2049
with:
21-
languages: scala
50+
languages: java
51+
queries: security-and-quality
52+
53+
# MANUAL BUILD: compile Scala so the extractor can see .class files
54+
- name: Compile (Scala -> JVM bytecode)
55+
run: |
56+
sbt ++${{ env.SCALA_VERSION }} -Dspark.version=${{ env.SPARK_VERSION }} \
57+
clean compile Test/compile
58+
59+
# Run the analysis after classes exist
2260
- uses: github/codeql-action/analyze@v3
61+
with:
62+
category: "/language:java"

0 commit comments

Comments
 (0)