88 schedule :
99 - cron : ' 34 10 * * 4'
1010
11+ permissions : {}
12+
1113jobs :
12- analyse :
13- name : Analyse
14+ CodeQL-Build :
15+ permissions :
16+ actions : read # for github/codeql-action/init to get workflow details
17+ contents : read # for actions/checkout to fetch code
18+ security-events : write # for github/codeql-action/analyze to upload SARIF results
1419 runs-on : ubuntu-latest
15- if : " !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
20+
21+ strategy :
22+ fail-fast : false
23+ matrix :
24+ # Override automatic language detection by changing the below list
25+ # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
26+ language : ['java', 'javascript']
27+ # Learn more...
28+ # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
29+
1630 steps :
17- - uses : actions/checkout@v4
18- with :
19- fetch-depth : 2
20- - uses : actions/setup-java@v4
21- with :
22- distribution : ' temurin'
23- java-version : ' 17'
24- - uses : actions/cache@v4
25- with :
26- path : ~/.m2/repository
27- key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
28- restore-keys : |
29- ${{ runner.os }}-maven-
30- - name : Initialize CodeQL
31- uses : github/codeql-action/init@v3
32- with :
33- languages : java
34- - name : Build
35- run : mvn -B compile
36- - name : Perform CodeQL Analysis
37- uses : github/codeql-action/analyze@v3
31+ - name : Checkout repository
32+ uses : actions/checkout@v4
33+ # Checkout must run before the caching key is computed using the `hashFiles` method
34+
35+ - name : Cache Gradle Modules
36+ uses : actions/cache@v4
37+ with :
38+ path : |
39+ ~/.gradle/caches/modules-2/
40+ ~/.gradle/caches/build-cache-1/
41+ ~/.gradle/caches/signatures/
42+ ~/.gradle/caches/keyrings/
43+ key : ${{ runner.os }}-gradle-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
44+ if : ${{ matrix.language == 'java' }}
45+
46+ - name : Disable checksum offloading
47+ # See: https://github.com/actions/virtual-environments/issues/1187#issuecomment-686735760
48+ run : sudo ethtool -K eth0 tx off rx off
49+
50+ # Install and setup JDK 17
51+ - name : Setup JDK 17
52+ uses : actions/setup-java@v4
53+ with :
54+ distribution : temurin
55+ java-version : 17
56+
57+ # Initializes the CodeQL tools for scanning.
58+ - name : Initialize CodeQL
59+ uses : github/codeql-action/init@v3
60+ with :
61+ languages : ${{ matrix.language }}
62+ tools : latest
63+ # If you wish to specify custom queries, you can do so here or in a config file.
64+ # By default, queries listed here will override any specified in a config file.
65+ # Prefix the list here with "+" to use these queries and those in the config file.
66+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
67+
68+ - name : Compile with Gradle with Build Scan
69+ if : ${{ matrix.language == 'java' && github.repository_owner == 'gradle' }}
70+ run : ./gradlew --init-script .github/workflows/codeql-analysis.init.gradle -DcacheNode=us -S testClasses -Dhttp.keepAlive=false
71+ env :
72+ # Set the DEVELOCITY_ACCESS_KEY so that Gradle Build Scans are generated
73+ DEVELOCITY_ACCESS_KEY : ${{ secrets.DEVELOCITY_ACCESS_KEY }}
74+ # Potential stop-gap solution for ReadTimeout issues with the Gradle Build Cache
75+ # https://gradle.slack.com/archives/CHDLT99C6/p1636477584059200
76+ GRADLE_OPTS : -Dhttp.keepAlive=false
77+ ORG_GRADLE_PROJECT_signingKey : ${{ secrets.GPG_PRIVATE_KEY }}
78+ ORG_GRADLE_PROJECT_signingKeyId : ${{ secrets.GPG_PRIVATE_KEY_ID }}
79+ ORG_GRADLE_PROJECT_signingPassword : ${{ secrets.GPG_PASSPHRASE }}
80+ ORG_GRADLE_PROJECT_sonatypeUsername : ${{ secrets.NEXUS_USERNAME }}
81+ ORG_GRADLE_PROJECT_sonatypePassword : ${{ secrets.NEXUS_PASSWORD }}
82+
83+ - name : Compile with Gradle without Build Scan
84+ if : ${{ matrix.language == 'java' && github.repository_owner != 'gradle' }}
85+ run : ./gradlew --init-script .github/workflows/codeql-analysis.init.gradle -S testClasses
86+
87+ - name : Cleanup Gradle Daemons
88+ run : ./gradlew --stop
89+ if : ${{ matrix.language == 'java' }}
90+
91+ # ℹ️ Command-line programs to run using the OS shell.
92+ # 📚 https://git.io/JvXDl
93+
94+ # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
95+ # and modify them (or add more) to build your code if your project
96+ # uses a compiled language
97+
98+ # - run: |
99+ # make bootstrap
100+ # make release
101+
102+ - name : Perform CodeQL Analysis
103+ uses : github/codeql-action/analyze@v3
104+ with :
105+ config-file : ./.github/codeql/codeql-config.yml
106+
107+ - name : Cleanup Gradle Cache
108+ # Cleans up the Gradle caches before being cached
109+ run : |
110+ rm -f ~/.gradle/caches/modules-2/modules-2.lock
111+ rm -f ~/.gradle/caches/modules-2/gc.properties
112+ if : ${{ matrix.language == 'java' }}
0 commit comments