Skip to content

Commit c072ffe

Browse files
committed
Cache codeql cli download
1 parent fb19792 commit c072ffe

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

.github/workflows/continuous-integration.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: "Continuous Integration with CodeQL"
22

3+
env:
4+
CODEQL_VERSION: v2.2.4
5+
36
on:
47
push:
58
pull_request:
@@ -16,11 +19,25 @@ jobs:
1619
with:
1720
ruby-version: 2.6
1821

22+
- name: Cache CodeQL download
23+
id: cache-codeql
24+
uses: actions/cache@v2
25+
env:
26+
cache-name: cache-codeql-download
27+
with:
28+
path: ./codeql
29+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.CODEQL_VERSION }}
30+
restore-keys: |
31+
${{ runner.os }}-build-${{ env.cache-name }}-
32+
${{ runner.os }}-build-
33+
${{ runner.os }}-
34+
1935
# Initializes the CodeQL tools for scanning.
2036
- name: Download CodeQL
37+
if: steps.cache-codeql.outputs.cache-hit != 'true'
2138
run: |
2239
echo "running curl -SsO in $PWD"
23-
curl -SsOL https://github.com/github/codeql-cli-binaries/releases/download/v2.2.4/codeql-linux64.zip
40+
curl -SsOL https://github.com/github/codeql-cli-binaries/releases/download/$CODEQL_VERSION/codeql-linux64.zip
2441
sleep 1
2542
echo "$PWD"
2643
ls -lha .
@@ -52,6 +69,10 @@ jobs:
5269
echo "$PWD"
5370
ls -lha .
5471
sleep 1
72+
echo "removing bad symlink if exists: running rm -f '$GITHUB_WORKSPACE/codeql/ruby'"
73+
sleep 1
74+
rm -f "$GITHUB_WORKSPACE/codeql/ruby"
75+
sleep 1
5576
echo "running ln -s '$GITHUB_WORKSPACE/codeql-ruby/extractor' '$GITHUB_WORKSPACE/codeql/ruby' in directory $PWD"
5677
sleep 1
5778
ln -s "$GITHUB_WORKSPACE/codeql-ruby/extractor" "$GITHUB_WORKSPACE/codeql/ruby"

0 commit comments

Comments
 (0)