Skip to content

CI: add CPM source cache to avoid re-cloning numsim-cas every build #27

Description

@petlenz

Summary

`.github/workflows/build.yml` doesn't set `CPM_SOURCE_CACHE` or use `actions/cache`, so each of the 4 matrix jobs (gcc-14 + clang-18 × Debug/Release) re-clones numsim-cas on every push. Cheap fix; opens a 10-30s CI speedup per cold build.

Fix

```yaml
env:
CPM_SOURCE_CACHE: ${{ github.workspace }}/.cpm-cache

steps:

  • uses: actions/checkout@v4

  • uses: actions/cache@v4
    with:
    path: ${{ env.CPM_SOURCE_CACHE }}
    key: cpm-${{ runner.os }}-${{ hashFiles('CMakeLists.txt') }}
    restore-keys: cpm-${{ runner.os }}-

... existing build steps ...

```

The cache key includes the CMakeLists.txt hash so a SHA bump on the numsim-cas pin invalidates the cache automatically.

Refs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions