Skip to content

Commit 8b11e98

Browse files
authored
Merge pull request #11162 from erik-krogh/ciCache
CI: try only to fill the compilation cache from main in the compile-queries workflow
2 parents 4cdcebf + 22d7f3c commit 8b11e98

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

.github/workflows/compile-queries.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ jobs:
2424
run: |
2525
MERGE_BASE=$(git merge-base --fork-point origin/$BASE_BRANCH)
2626
echo "merge-base=$MERGE_BASE" >> $GITHUB_ENV
27-
- name: Calculate merge-base - branch
28-
if: ${{ github.event_name != 'pull_request' }}
29-
# using github.sha instead, since we're directly on a branch, and not in a PR
30-
run: |
31-
MERGE_BASE=${{ github.sha }}
32-
echo "merge-base=$MERGE_BASE" >> $GITHUB_ENV
33-
- name: Cache CodeQL query compilation
27+
- name: Read CodeQL query compilation - PR
28+
if: ${{ github.event_name == 'pull_request' }}
3429
uses: actions/cache@v3
3530
with:
3631
path: '*/ql/src/.cache'
37-
# current GH HEAD first, merge-base second, generic third
38-
key: codeql-stable-compile-${{ github.sha }}
32+
key: codeql-compile-pr-${{ github.sha }} # deliberately not using the `compile-compile-main` keys here.
3933
restore-keys: |
40-
codeql-stable-compile-${{ env.merge-base }}
41-
codeql-stable-compile-
34+
codeql-compile-main-${{ env.merge-base }}
35+
codeql-compile-main-
36+
- name: Fill CodeQL query compilation cache - main
37+
if: ${{ github.event_name != 'pull_request' }}
38+
uses: actions/cache@v3
39+
with:
40+
path: '*/ql/src/.cache'
41+
key: codeql-compile-main-${{ github.sha }} # just fill on main
4242
- name: Setup CodeQL
4343
uses: ./.github/actions/fetch-codeql
4444
with:

0 commit comments

Comments
 (0)