Skip to content

Commit d8705df

Browse files
committed
cache entire pack
1 parent e88d7d5 commit d8705df

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

.github/workflows/ql-for-ql-build.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,32 @@ jobs:
2727
shell: bash
2828
env:
2929
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
30+
- name: Cache entire pack
31+
id: cache-pack
32+
uses: actions/cache@v3
33+
with:
34+
path: ${{ runner.temp }}/pack
35+
key: ${{ runner.os }}-pack-${{ hashFiles('ql/**/Cargo.lock') }}-${{ hashFiles('ql/**/*.rs') }}-${{ hashFiles('ql/**/*.ql*') }}-${{ hashFiles('ql/**/qlpack.yml') }}-${{ hashFiles('ql/ql/src/ql.dbscheme*') }}-${{ steps.get-codeql-version.outputs.version }}--${{ hashFiles('.github/workflows/ql-for-ql-build.yml') }}
3036
- name: Cache queries
37+
if: steps.cache-pack.outputs.cache-hit != 'true'
3138
id: cache-queries
3239
uses: actions/cache@v3
3340
with:
34-
path: ${{ runner.temp }}/pack
41+
path: ${{ runner.temp }}/queries
3542
key: queries-${{ hashFiles('ql/**/*.ql*') }}-${{ hashFiles('ql/**/qlpack.yml') }}-${{ hashFiles('ql/ql/src/ql.dbscheme*') }}-${{ steps.get-codeql-version.outputs.version }}--${{ hashFiles('.github/workflows/ql-for-ql-build.yml') }}
3643
- name: Build query pack
37-
if: steps.cache-queries.outputs.cache-hit != 'true'
44+
if: steps.cache-queries.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
3845
run: |
3946
cd ql/ql/src
4047
"${CODEQL}" pack create -j 16
41-
mv .codeql/pack/codeql/ql/0.0.0 ${{ runner.temp }}/pack
48+
mv .codeql/pack/codeql/ql/0.0.0 ${{ runner.temp }}/queries
49+
cp -r ${{ runner.temp }}/queries ${{ runner.temp }}/pack
4250
env:
4351
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
4452

4553
### Build the extractor ###
4654
- name: Cache entire extractor
55+
if: steps.cache-pack.outputs.cache-hit != 'true'
4756
id: cache-extractor
4857
uses: actions/cache@v3
4958
with:
@@ -54,7 +63,7 @@ jobs:
5463
ql/target/release/ql-extractor.exe
5564
key: ${{ runner.os }}-extractor-${{ hashFiles('ql/**/Cargo.lock') }}-${{ hashFiles('ql/**/*.rs') }}
5665
- name: Cache cargo
57-
if: steps.cache-extractor.outputs.cache-hit != 'true'
66+
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
5867
uses: actions/cache@v3
5968
with:
6069
path: |
@@ -63,19 +72,19 @@ jobs:
6372
ql/target
6473
key: ${{ runner.os }}-rust-cargo-${{ hashFiles('ql/**/Cargo.lock') }}
6574
- name: Check formatting
66-
if: steps.cache-extractor.outputs.cache-hit != 'true'
75+
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
6776
run: cd ql; cargo fmt --all -- --check
6877
- name: Build
69-
if: steps.cache-extractor.outputs.cache-hit != 'true'
78+
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
7079
run: cd ql; cargo build --verbose
7180
- name: Run tests
72-
if: steps.cache-extractor.outputs.cache-hit != 'true'
81+
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
7382
run: cd ql; cargo test --verbose
7483
- name: Release build
75-
if: steps.cache-extractor.outputs.cache-hit != 'true'
84+
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
7685
run: cd ql; cargo build --release
7786
- name: Generate dbscheme
78-
if: steps.cache-extractor.outputs.cache-hit != 'true'
87+
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
7988
run: ql/target/release/ql-generator --dbscheme ql/ql/src/ql.dbscheme --library ql/ql/src/codeql_ql/ast/internal/TreeSitter.qll
8089

8190
### Package the queries and extractor ###

0 commit comments

Comments
 (0)