File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 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
- run : codeql query compile -j0 */ql/src --keep-going --warnings=error
59
+ run : |
60
+ # Move all the existing cache into another folder, so we only preserve the cache for the current queries.
61
+ mkdir -p ${COMBINED_CACHE_DIR}
62
+ rm */ql/src/.cache/{lock,size}
63
+ # replicate the folder structure from the .cache folders into the combined cache folder. (because cp doesn't have a "create missing folders" option)
64
+ find */ql/src/.cache -type d | cut -d "/" -f 6,7 | sort | uniq > folders.txt
65
+ cat folders.txt | xargs -I {} mkdir -p ${COMBINED_CACHE_DIR}/{}
66
+ # copy the contents of the .cache folders into the combined cache folder.
67
+ cp -r */ql/src/.cache/* ${COMBINED_CACHE_DIR}/
68
+ # clean up the .cache folders
69
+ rm -rf */ql/src/.cache/*
70
+ rm folders.txt
71
+
72
+ # compile the queries
73
+ codeql query compile -j0 */ql/src --keep-going --warnings=error --compilation-cache ${COMBINED_CACHE_DIR}
74
+ env :
75
+ COMBINED_CACHE_DIR : ${{ github.workspace }}/compilation-dir
You can’t perform that action at this time.
0 commit comments