@@ -27,23 +27,31 @@ jobs:
27
27
shell : bash
28
28
env :
29
29
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') }}
30
36
- name : Cache queries
37
+ if : steps.cache-pack.outputs.cache-hit != 'true'
31
38
id : cache-queries
32
39
uses : actions/cache@v3
33
40
with :
34
- path : ${{ runner.temp }}/pack
41
+ path : ${{ runner.temp }}/queries
35
42
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') }}
36
43
- 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'
38
45
run : |
39
46
cd ql/ql/src
40
47
"${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
42
49
env :
43
50
CODEQL : ${{ steps.find-codeql.outputs.codeql-path }}
44
51
45
52
# ## Build the extractor ###
46
53
- name : Cache entire extractor
54
+ if : steps.cache-pack.outputs.cache-hit != 'true'
47
55
id : cache-extractor
48
56
uses : actions/cache@v3
49
57
with :
54
62
ql/target/release/ql-extractor.exe
55
63
key : ${{ runner.os }}-extractor-${{ hashFiles('ql/**/Cargo.lock') }}-${{ hashFiles('ql/**/*.rs') }}
56
64
- 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'
58
66
uses : actions/cache@v3
59
67
with :
60
68
path : |
@@ -63,23 +71,24 @@ jobs:
63
71
ql/target
64
72
key : ${{ runner.os }}-rust-cargo-${{ hashFiles('ql/**/Cargo.lock') }}
65
73
- 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'
67
75
run : cd ql; cargo fmt --all -- --check
68
76
- 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'
70
78
run : cd ql; cargo build --verbose
71
79
- 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'
73
81
run : cd ql; cargo test --verbose
74
82
- 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'
76
84
run : cd ql; cargo build --release
77
85
- 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'
79
87
run : ql/target/release/ql-generator --dbscheme ql/ql/src/ql.dbscheme --library ql/ql/src/codeql_ql/ast/internal/TreeSitter.qll
80
88
81
89
# ## Package the queries and extractor ###
82
90
- run : |
91
+ cp -r ${{ runner.temp }}/queries ${PACK}/
83
92
cp -r ql/codeql-extractor.yml ql/tools ql/ql/src/ql.dbscheme.stats ${PACK}/
84
93
mkdir -p ${PACK}/tools/linux64
85
94
cp ql/target/release/ql-autobuilder ${PACK}/tools/linux64/autobuilder
0 commit comments