Skip to content

Commit 28e899e

Browse files
rPramlgbrail
authored andcommitted
Added GH gradle cache for CodeQl
This will reduce check time about 40s and the traffic to plugins.gradle.org/m2 inspired by gradle/gradle@3d4f7a1 https://github.com/gradle/gradle/blob/master/.github/workflows/codeql-analysis.yml
1 parent 4e4e02b commit 28e899e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ jobs:
3030
- name: Checkout repository
3131
uses: actions/checkout@v4
3232

33+
- name: Cache Gradle Modules
34+
uses: actions/cache@v4
35+
with:
36+
path: |
37+
~/.gradle/wrapper
38+
~/.gradle/caches
39+
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
40+
3341
# Initializes the CodeQL tools for scanning.
3442
- name: Initialize CodeQL
3543
uses: github/codeql-action/init@v3
@@ -57,3 +65,9 @@ jobs:
5765
uses: github/codeql-action/analyze@v3
5866
with:
5967
category: "/language:${{matrix.language}}"
68+
69+
- name: Cleanup Gradle Cache
70+
# Cleans up the Gradle caches before being cached
71+
run: |
72+
rm -f ~/.gradle/caches/modules-2/modules-2.lock
73+
rm -f ~/.gradle/caches/modules-2/gc.properties

0 commit comments

Comments
 (0)