22name : CodeQL
33
44on : # https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows
5+ schedule :
6+ # https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#schedule
7+ - cron : " 30 18 * * 1" # Mondays 18:30 UTC
58 push :
69 branches : [ "main" ]
710 paths-ignore :
811 - ' **/*.md'
9- - ' .github/*.yml'
10- - ' .github/workflows/build.yml'
11- - ' .github/workflows/bump-version.yml'
12- - ' .github/workflows/licensecheck.yml'
13- - ' .github/workflows/validate_pr.yml'
1412 - ' **/.project'
1513 - ' **/.settings/*.prefs'
1614 - ' .gitignore'
@@ -20,11 +18,6 @@ on: # https://docs.github.com/en/actions/reference/workflows-and-actions/events
2018 branches : [ "main" ]
2119 paths-ignore :
2220 - ' **/*.md'
23- - ' .github/*.yml'
24- - ' .github/workflows/build.yml'
25- - ' .github/workflows/bump-version.yml'
26- - ' .github/workflows/licensecheck.yml'
27- - ' .github/workflows/validate_pr.yml'
2821 - ' **/.project'
2922 - ' **/.settings/*.prefs'
3023 - ' .gitignore'
@@ -34,20 +27,35 @@ on: # https://docs.github.com/en/actions/reference/workflows-and-actions/events
3427 # https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#workflow_dispatch
3528
3629
30+ defaults :
31+ run :
32+ shell : bash
33+
34+
35+ env :
36+ JAVA_VERSION : 21
37+
38+
3739jobs :
3840
3941 # ##########################################################
4042 analyze :
4143 # ##########################################################
4244
45+ concurrency :
46+ group : codeql-${{ github.workflow }}-${{ github.ref }}-${{ matrix.language }}
47+ cancel-in-progress : true
48+
4349 strategy :
4450 fail-fast : false
4551 matrix :
4652 include :
4753 # build-mode: https://github.com/github/codeql-action#build-modes
48- - language : java-kotlin
54+ - language : actions
4955 build-mode : none
50- - language : javascript-typescript
56+ - language : java
57+ build-mode : manual
58+ - language : javascript
5159 build-mode : none
5260 - language : python
5361 build-mode : none
@@ -82,15 +90,47 @@ jobs:
8290 uses : actions/checkout@v5 # https://github.com/actions/checkout
8391
8492
85- # CodeQL executes https://github.com/ferstl/depgraph-maven-plugin
93+ - name : " Install: JDK 21 for Compilation ☕"
94+ uses : actions/setup-java@v5 # https://github.com/actions/setup-java
95+ if : matrix.language == 'java'
96+ with :
97+ distribution : temurin
98+ java-version : 21
99+
100+
86101 - name : " Install: JDK 25 for Maven/Tycho ☕"
87102 uses : actions/setup-java@v5 # https://github.com/actions/setup-java
88- if : ${{ matrix.language }} == 'java'
103+ if : matrix.language == 'java'
89104 with :
90105 distribution : temurin
91106 java-version : 25
92107
93108
109+ - name : " Cache: Local Maven Repository"
110+ uses : actions/cache/restore@v4
111+ if : matrix.language == 'java'
112+ with :
113+ # Excluded sub directory not working https://github.com/actions/toolkit/issues/713
114+ path : |
115+ ~/.m2/repository/*
116+ !~/.m2/repository/.cache/tycho
117+ !~/.m2/repository/.meta/p2-artifacts.properties
118+ !~/.m2/repository/p2
119+ !~/.m2/repository/*SNAPSHOT*
120+ key : ${{ runner.os }}-${{ runner.arch }}-repo-mvn-${{ hashFiles('**/pom.xml') }}
121+
122+
123+ - name : " Cache: Local Tycho Repository"
124+ uses : actions/cache/restore@v4
125+ if : matrix.language == 'java'
126+ with :
127+ path : |
128+ ~/.m2/repository/.cache/tycho
129+ ~/.m2/repository/.meta/p2-artifacts.properties
130+ ~/.m2/repository/p2
131+ key : ${{ runner.os }}-${{ runner.arch }}-repo-tycho-${{ hashFiles('target-platforms/target-platform-latest/target-platform-latest.target') }}
132+
133+
94134 # https://docs.github.com/en/code-security/code-scanning
95135 - name : Initialize CodeQL
96136 uses : github/codeql-action/init@v4 # https://github.com/github/codeql-action
@@ -99,7 +139,29 @@ jobs:
99139 # https://github.com/github/codeql-action#build-modes
100140 build-mode : ${{ matrix.build-mode }}
101141 # https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#using-queries-in-ql-packs
102- queries : +security-and-quality
142+ config-file : ./.github/codeql/codeql-config.yml
143+
144+
145+ - name : " Build with Maven 🔨"
146+ if : matrix.language == 'java'
147+ run : |
148+ set -euo pipefail
149+
150+ MAVEN_OPTS="${MAVEN_OPTS:-}"
151+ MAVEN_OPTS+=" -Djava.security.egd=file:/dev/./urandom" # https://stackoverflow.com/questions/58991966/what-java-security-egd-option-is-for/59097932#59097932
152+ MAVEN_OPTS+=" -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS" # https://stackoverflow.com/questions/5120470/how-to-time-the-different-stages-of-maven-execution/49494561#49494561
153+ MAVEN_OPTS+=" -Xmx1024m -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dhttps.protocols=TLSv1.3,TLSv1.2"
154+ export MAVEN_OPTS
155+ echo "MAVEN_OPTS: $MAVEN_OPTS"
156+
157+ ./mvnw \
158+ --errors \
159+ --no-transfer-progress \
160+ --batch-mode \
161+ --show-version \
162+ -Declipse.p2.mirrors=false \
163+ -Dmaven.test.skip=true \
164+ clean verify
103165
104166
105167 - name : Perform CodeQL Analysis
0 commit comments