2626 if : ${{ github.event_name == 'pull_request' }}
2727 uses : actions/cache@v3
2828 with :
29- path : ' */ql/src /.cache'
29+ path : ' ** /.cache'
3030 key : codeql-compile-pr-${{ github.sha }} # deliberately not using the `compile-compile-main` keys here.
3131 restore-keys : |
3232 codeql-compile-${{ github.base_ref }}-${{ env.merge-base }}
3636 if : ${{ github.event_name != 'pull_request' }}
3737 uses : actions/cache@v3
3838 with :
39- path : ' */ql/src /.cache'
39+ path : ' ** /.cache'
4040 key : codeql-compile-${{ github.ref_name }}-${{ github.sha }} # just fill on main
4141 restore-keys : | # restore from another random commit, to speed up compilation.
4242 codeql-compile-${{ github.ref_name }}-
@@ -51,21 +51,21 @@ jobs:
5151 # run with --check-only if running in a PR (github.sha != main)
5252 if : ${{ github.event_name == 'pull_request' }}
5353 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
5555 - name : compile queries - full
5656 # do full compile if running on main - this populates the cache
5757 if : ${{ github.event_name != 'pull_request' }}
5858 shell : bash
5959 run : |
6060 # Move all the existing cache into another folder, so we only preserve the cache for the current queries.
6161 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.
6363 # 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
6565 # clean up the .cache folders
66- rm -rf */ql/src/.cache/*
66+ rm -rf */ql/{ src,examples} /.cache/*
6767
6868 # 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}
7070 env :
7171 COMBINED_CACHE_DIR : ${{ github.workspace }}/compilation-dir
0 commit comments