@@ -27,23 +27,32 @@ 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
49
+ cp -r ${{ runner.temp }}/queries ${{ runner.temp }}/pack
42
50
env :
43
51
CODEQL : ${{ steps.find-codeql.outputs.codeql-path }}
44
52
45
53
# ## Build the extractor ###
46
54
- name : Cache entire extractor
55
+ if : steps.cache-pack.outputs.cache-hit != 'true'
47
56
id : cache-extractor
48
57
uses : actions/cache@v3
49
58
with :
54
63
ql/target/release/ql-extractor.exe
55
64
key : ${{ runner.os }}-extractor-${{ hashFiles('ql/**/Cargo.lock') }}-${{ hashFiles('ql/**/*.rs') }}
56
65
- 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'
58
67
uses : actions/cache@v3
59
68
with :
60
69
path : |
@@ -63,19 +72,19 @@ jobs:
63
72
ql/target
64
73
key : ${{ runner.os }}-rust-cargo-${{ hashFiles('ql/**/Cargo.lock') }}
65
74
- 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'
67
76
run : cd ql; cargo fmt --all -- --check
68
77
- 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'
70
79
run : cd ql; cargo build --verbose
71
80
- 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'
73
82
run : cd ql; cargo test --verbose
74
83
- 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'
76
85
run : cd ql; cargo build --release
77
86
- 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'
79
88
run : ql/target/release/ql-generator --dbscheme ql/ql/src/ql.dbscheme --library ql/ql/src/codeql_ql/ast/internal/TreeSitter.qll
80
89
81
90
# ## Package the queries and extractor ###
0 commit comments