Skip to content

GitHub workflows improvements#532

Merged
fedorov merged 4 commits intomasterfrom
workflows-improvements
Apr 1, 2026
Merged

GitHub workflows improvements#532
fedorov merged 4 commits intomasterfrom
workflows-improvements

Conversation

@fedorov
Copy link
Copy Markdown
Member

@fedorov fedorov commented Apr 1, 2026

Summary

This PR contains three CI workflow improvements across all platforms (Linux, macOS, Windows).

Fix stale commit on latest prerelease after asset upload

After uploading artifacts to the latest pre-release, gh release edit latest --target $(git rev-parse HEAD) is now called on all three platforms. Previously, only the assets were replaced while the release tag remained frozen at the old commit, causing the release page to show a stale hash and date.

Update actions to Node.js 24 compatible versions

actions/checkout upgraded v3v4 and actions/setup-python upgraded v4v5 across all three workflows, addressing Node.js 20 deprecation warnings in the runner.

Always save dep caches even on job failure; fix Windows cache key (macOS, Windows)

Problem: Reviewing recent workflow runs showed that the dep cache (DCMTK, ITK, zlib) was never saved after a failed build. actions/cache@v4 only saves on job success by default, so a failed macOS build meant the next run had to rebuild all deps from scratch (~30 min on macOS).

Fix: Replaced the single actions/cache@v4 step with separate actions/cache/restore@v4 + actions/cache/save@v4 steps. The save step uses if: always() && cache-hit != 'true', which saves the dep cache even when a later step (test, packaging) fails, and skips re-uploading when the cache was already a hit.

Windows cache key fix: The Windows cache key previously hashed CMakeLists.txt in addition to CMakeExternals/*.cmake. Changes to CMakeLists.txt (which happen frequently for dcmqi-only changes) were needlessly busting the dep cache. The key now only covers CMakeExternals/*.cmake, consistent with macOS.

Test plan

  • Verify all three platform builds pass
  • Verify the latest release target commit updates to the current HEAD after a successful prerelease upload
  • Trigger a build where the dep build succeeds but a test fails; confirm the dep cache is saved and the next run restores it

fedorov and others added 4 commits April 1, 2026 11:55
After uploading artifacts to the 'latest' pre-release, call
`gh release edit latest --target $(git rev-parse HEAD)` so the release
is re-pointed to the current commit. Previously, only assets were
replaced while the release tag remained frozen at the old commit,
causing the release page to show a stale hash and date.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Upgrade actions/checkout v3->v4 and actions/setup-python v4->v5 across
all three CI workflows to address Node.js 20 deprecation warnings.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- Switch macOS and Windows from actions/cache@v4 to separate
  cache/restore + cache/save steps so deps (DCMTK, ITK, zlib)
  are cached even when the build or test step fails
- Add if: always() && cache-hit != 'true' guard on save steps
- Remove CMakeLists.txt from Windows cache key hash so that
  dcmqi-only changes don't bust the dep cache (matches macOS)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 1, 2026

@fedorov fedorov merged commit 8b161f9 into master Apr 1, 2026
11 checks passed
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.

1 participant