Skip to content

CI: experiment state cache for incremental build #7360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,24 @@ jobs:
fi
shell: bash

- name: Compiler build state key
id: compiler-build-state-key
shell: bash
run: |
echo "value=compiler-build-state-v1-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('dune-project') }}" \
| sed 's/,/-/g' >> "$GITHUB_OUTPUT"

- name: Restore compiler build state
if: github.base_ref == 'master'
id: compiler-build-state
uses: actions/cache/restore@v4
with:
path: |
D:\.cache\dune
~/.cache/dune
_build
key: ${{ steps.compiler-build-state-key.outputs.value }}

- name: Build compiler
if: runner.os != 'Linux'
run: opam exec -- dune build --display quiet --profile release
Expand All @@ -252,6 +270,16 @@ jobs:
if: runner.os == 'Linux'
run: opam exec -- dune build --display quiet --profile static

- name: Save compiler build state
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: actions/cache/save@v4
with:
path: |
D:\.cache\dune
~/.cache/dune
_build
key: ${{ steps.compiler-build-state-key.outputs.value }}

- name: Install npm packages
run: npm ci --ignore-scripts

Expand Down