Skip to content

Commit

Permalink
Merge pull request #11272 from erik-krogh/clean-cache
Browse files Browse the repository at this point in the history
CI: clean up the cache when compiling on main
  • Loading branch information
erik-krogh authored Nov 17, 2022
2 parents ba894e2 + e4b0d8d commit 45d4318
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/compile-queries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,16 @@ jobs:
# do full compile if running on main - this populates the cache
if : ${{ github.event_name != 'pull_request' }}
shell: bash
run: codeql query compile -j0 */ql/src --keep-going --warnings=error
run: |
# Move all the existing cache into another folder, so we only preserve the cache for the current queries.
mkdir -p ${COMBINED_CACHE_DIR}
rm */ql/src/.cache/{lock,size}
# copy the contents of the .cache folders into the combined cache folder.
cp -r */ql/src/.cache/* ${COMBINED_CACHE_DIR}/
# clean up the .cache folders
rm -rf */ql/src/.cache/*
# compile the queries
codeql query compile -j0 */ql/src --keep-going --warnings=error --compilation-cache ${COMBINED_CACHE_DIR}
env:
COMBINED_CACHE_DIR: ${{ github.workspace }}/compilation-dir

0 comments on commit 45d4318

Please sign in to comment.