Skip to content

Commit 80956ca

Browse files
authored
CI: fix compile_commands.json caching (xapi-project#6356)
When the cache for compile_commands.json got reused we didn't install the OCaml compiler, which caused failures in the static analyzer, because it couldn't locate the compiler runtime headers. Do not skip setup-xapi-environment when the cache is reused. This could be optimized to skip installing dune packages (install just the compiler), but for now just install everything to avoid the error. Now when the cache is used we only skip installing/running dune-compiledb.
2 parents 03c1780 + 8c10110 commit 80956ca

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

.github/workflows/codechecker.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,39 +27,22 @@ jobs:
2727
- name: Checkout code
2828
uses: actions/checkout@v4
2929

30-
- name: Restore cache for compile_commands.json
31-
uses: actions/cache/restore@v4
32-
id: cache-cmds
33-
with:
34-
path: compile_commands.json
35-
key: compile_commands.json-v1-${{ hashFiles('**/dune') }}
36-
3730
- name: Setup XenAPI environment
38-
if: steps.cache-cmds.outputs.cache-hit != 'true'
3931
uses: ./.github/workflows/setup-xapi-environment
4032
with:
4133
xapi_version: ${{ env.XAPI_VERSION }}
4234

4335
- name: Install dune-compiledb to generate compile_commands.json
44-
if: steps.cache-cmds.outputs.cache-hit != 'true'
4536
run: |
4637
opam pin add -y ezjsonm https://github.com/mirage/ezjsonm/releases/download/v1.3.0/ezjsonm-1.3.0.tbz
4738
opam pin add -y dune-compiledb https://github.com/edwintorok/dune-compiledb/releases/download/0.6.0/dune-compiledb-0.6.0.tbz
4839
4940
- name: Trim dune cache
50-
if: steps.cache-cmds.outputs.cache-hit != 'true'
5141
run: opam exec -- dune cache trim --size=2GiB
5242

5343
- name: Generate compile_commands.json
54-
if: steps.cache-cmds.outputs.cache-hit != 'true'
5544
run: opam exec -- make compile_commands.json
5645

57-
- name: Save cache for cmds.json
58-
uses: actions/cache/save@v4
59-
with:
60-
path: compile_commands.json
61-
key: ${{ steps.cache-cmds.outputs.cache-primary-key }}
62-
6346
- name: Upload compile commands json
6447
uses: actions/upload-artifact@v4
6548
with:

0 commit comments

Comments
 (0)