Skip to content

ci: share ISO build steps between test and release workflows#60

Open
phorcys420 wants to merge 1 commit into
mainfrom
ci/share-iso-build-actions
Open

ci: share ISO build steps between test and release workflows#60
phorcys420 wants to merge 1 commit into
mainfrom
ci/share-iso-build-actions

Conversation

@phorcys420

Copy link
Copy Markdown
Member

What

Make the release workflow build images the same way the test workflow does by extracting the duplicated CI steps into two shared composite actions.

Why

release.yml and test.yml each had their own copies of the "install Nix + cache /nix/store" boilerplate and the make <target>/iso → dereference-ISO-and-.sha256 build logic. They could drift apart. Sharing the steps guarantees releases and PR/test builds go through identical code.

Changes

New composite actions

  • .github/actions/setup-nix — install Nix natively (nix-installer-action) + cache /nix/store (cache-nix-action). Inputs cache-key-prefix (default nix-images) and gc-max-store-size (default 8G) so the cheap flake-check job keeps its own smaller nix-flake / 5G cache.
  • .github/actions/build-iso — build one image kind. make <target>/iso + dereference the image and its .sha256 sidecar into a dist dir, or make <target>/drv when full: false. Inputs: target, full, iso-compression, pr-title/pr-number/branch, optional dist (test accumulates installer + appliance into one dir); output dist.

Workflows

  • release.yml — build job now uses setup-nix + build-iso. Passes no compression/PR inputs, so releases keep the slow nixpkgs default (small shipped ISOs) and plain version names — unchanged behavior.
  • test.ymlflake job uses setup-nix (nix-flake/5G); Images job stages one dist dir then builds each kind via build-iso, keeping the fast zstd -Xcompression-level 3 and PR/branch stamping. Downstream size-recording + per-kind artifact uploads unchanged.

Notes

  • fmt.yml still has its own Nix setup; it's a formatting workflow (not image building), left out of scope.

Validation

  • YAML parses for all four files.
  • actionlint passes clean.

Extract the duplicated Nix-setup and image-build steps into two composite
actions so the release workflow builds images the same way the test workflow
does:

- .github/actions/setup-nix: install Nix natively + cache /nix/store, with
  configurable cache prefix / gc cap (nix-images default, nix-flake/5G for the
  cheap flake-check job).
- .github/actions/build-iso: build one image kind (full ISO or drv-only),
  dereferencing the image + .sha256 sidecar into a dist dir.

release.yml and test.yml (flake + Images jobs) now use these shared actions.
Release keeps the slow default compression and plain version names; test keeps
its fast compression and PR/branch stamping via the action inputs.
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