26
26
if : ${{ github.event_name == 'pull_request' }}
27
27
uses : actions/cache@v3
28
28
with :
29
- path : ' */ql/src /.cache'
29
+ path : ' ** /.cache'
30
30
key : codeql-compile-pr-${{ github.sha }} # deliberately not using the `compile-compile-main` keys here.
31
31
restore-keys : |
32
32
codeql-compile-${{ github.base_ref }}-${{ env.merge-base }}
36
36
if : ${{ github.event_name != 'pull_request' }}
37
37
uses : actions/cache@v3
38
38
with :
39
- path : ' */ql/src /.cache'
39
+ path : ' ** /.cache'
40
40
key : codeql-compile-${{ github.ref_name }}-${{ github.sha }} # just fill on main
41
41
restore-keys : | # restore from another random commit, to speed up compilation.
42
42
codeql-compile-${{ github.ref_name }}-
@@ -51,21 +51,21 @@ jobs:
51
51
# run with --check-only if running in a PR (github.sha != main)
52
52
if : ${{ github.event_name == 'pull_request' }}
53
53
shell : bash
54
- run : codeql query compile -j0 */ql/src --keep-going --warnings=error --check-only
54
+ run : codeql query compile -j0 */ql/{ src,examples} --keep-going --warnings=error --check-only
55
55
- name : compile queries - full
56
56
# do full compile if running on main - this populates the cache
57
57
if : ${{ github.event_name != 'pull_request' }}
58
58
shell : bash
59
59
run : |
60
60
# Move all the existing cache into another folder, so we only preserve the cache for the current queries.
61
61
mkdir -p ${COMBINED_CACHE_DIR}
62
- rm */ql/src/.cache/{lock,size}
62
+ rm -f */ql/{ src,examples} /.cache/{lock,size} # -f to avoid errors if the cache is empty.
63
63
# copy the contents of the .cache folders into the combined cache folder.
64
- cp -r */ql/src/.cache/* ${COMBINED_CACHE_DIR}/
64
+ cp -r */ql/{ src,examples} /.cache/* ${COMBINED_CACHE_DIR}/ || : # ignore missing files
65
65
# clean up the .cache folders
66
- rm -rf */ql/src/.cache/*
66
+ rm -rf */ql/{ src,examples} /.cache/*
67
67
68
68
# compile the queries
69
- codeql query compile -j0 */ql/src --keep-going --warnings=error --compilation-cache ${COMBINED_CACHE_DIR}
69
+ codeql query compile -j0 */ql/{ src,examples} --keep-going --warnings=error --compilation-cache ${COMBINED_CACHE_DIR}
70
70
env :
71
71
COMBINED_CACHE_DIR : ${{ github.workspace }}/compilation-dir
0 commit comments