Skip to content

Commit 0db07d3

Browse files
committed
cache the entire pack
1 parent e88d7d5 commit 0db07d3

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,31 @@ 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
4249
env:
4350
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
4451

4552
### Build the extractor ###
4653
- name: Cache entire extractor
54+
if: steps.cache-pack.outputs.cache-hit != 'true'
4755
id: cache-extractor
4856
uses: actions/cache@v3
4957
with:
@@ -54,7 +62,7 @@ jobs:
5462
ql/target/release/ql-extractor.exe
5563
key: ${{ runner.os }}-extractor-${{ hashFiles('ql/**/Cargo.lock') }}-${{ hashFiles('ql/**/*.rs') }}
5664
- name: Cache cargo
57-
if: steps.cache-extractor.outputs.cache-hit != 'true'
65+
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
5866
uses: actions/cache@v3
5967
with:
6068
path: |
@@ -63,23 +71,24 @@ jobs:
6371
ql/target
6472
key: ${{ runner.os }}-rust-cargo-${{ hashFiles('ql/**/Cargo.lock') }}
6573
- name: Check formatting
66-
if: steps.cache-extractor.outputs.cache-hit != 'true'
74+
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
6775
run: cd ql; cargo fmt --all -- --check
6876
- name: Build
69-
if: steps.cache-extractor.outputs.cache-hit != 'true'
77+
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
7078
run: cd ql; cargo build --verbose
7179
- name: Run tests
72-
if: steps.cache-extractor.outputs.cache-hit != 'true'
80+
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
7381
run: cd ql; cargo test --verbose
7482
- name: Release build
75-
if: steps.cache-extractor.outputs.cache-hit != 'true'
83+
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
7684
run: cd ql; cargo build --release
7785
- name: Generate dbscheme
78-
if: steps.cache-extractor.outputs.cache-hit != 'true'
86+
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
7987
run: ql/target/release/ql-generator --dbscheme ql/ql/src/ql.dbscheme --library ql/ql/src/codeql_ql/ast/internal/TreeSitter.qll
8088

8189
### Package the queries and extractor ###
8290
- run: |
91+
cp -r ${{ runner.temp }}/queries ${PACK}/
8392
cp -r ql/codeql-extractor.yml ql/tools ql/ql/src/ql.dbscheme.stats ${PACK}/
8493
mkdir -p ${PACK}/tools/linux64
8594
cp ql/target/release/ql-autobuilder ${PACK}/tools/linux64/autobuilder

0 commit comments

Comments
 (0)