Skip to content

Add caching to the api-breakage check#74

Merged
gwynne merged 7 commits intomainfrom
gwynne-patch-1
Mar 10, 2026
Merged

Add caching to the api-breakage check#74
gwynne merged 7 commits intomainfrom
gwynne-patch-1

Conversation

@gwynne
Copy link
Member

@gwynne gwynne commented Mar 10, 2026

Just for you, @MahdiBM 😘

@gwynne gwynne requested review from 0xTim, MahdiBM and ptoffy March 10, 2026 12:51
run: |
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
swift package ${PACKAGE_ROOT} diagnose-api-breaking-changes --baseline-dir=${BASELINES} --regenerate-baseline origin/main
- { name: Cache API baseline, uses: actions/cache/save@v5, with: { path: "${{ env.BASELINES }}", key: api-breakage } }
Copy link
Contributor

@MahdiBM MahdiBM Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this key, what happens is that in the first run the "restore" step doesn't have anything to restore, but the "cache" step will cache the build.

Then in the second run the "restore" step will work, but then the "cache" step never does anything because the cache key is always the same and so the action says "this cache already exists". It doesn't replace or update the old cache.

So we probably would want to have some kind of hash in front of the key.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There, better now? 🙂

@gwynne gwynne requested a review from MahdiBM March 10, 2026 14:05
@gwynne gwynne merged commit 20699c7 into main Mar 10, 2026
41 of 42 checks passed
@gwynne gwynne deleted the gwynne-patch-1 branch March 10, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants