Skip to content

Commit 8c92fb2

Browse files
committed
ci: add make check, bundle each ISO with its checksum
- Add a 'check' Makefile target wrapping nix flake check (with NIX_PERF_FLAGS) and point test.yml's flake job at 'make check'. - Collapse the per-kind ISO + checksum uploads into one upload-artifact step per kind: each bundles its own ISO with its .sha256 sidecar (uploaded concurrently within the artifact) while keeping installer and appliance in separate artifacts.
1 parent b5d090b commit 8c92fb2

2 files changed

Lines changed: 22 additions & 23 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ jobs:
8484
restore-prefixes-first-match: nix-flake-${{ runner.os }}-${{ runner.arch }}-
8585
gc-max-store-size-linux: 5G
8686

87-
- name: nix flake check
88-
run: nix flake check --impure --no-build --all-systems
87+
- name: Flake check
88+
run: make check
8989

9090
# Tiny pre-job that decides, per kind, whether to build the full ISO or just
9191
# instantiate the derivation, and assembles a short human title for the build
@@ -221,39 +221,30 @@ jobs:
221221
build_kind appliance "$APPLIANCE_FULL"
222222
ls -lh "$dist"
223223
224+
# One artifact per kind, each bundling that kind's ISO with its .sha256
225+
# sidecar (a single upload-artifact step uploads its matched files
226+
# CONCURRENTLY, so the multi-GB ISO and its checksum go up together).
227+
# Installer and appliance stay in SEPARATE artifacts so each kind can be
228+
# downloaded on its own. Each step runs only when its kind built full.
224229
- name: Upload installer ISO artifact
225230
if: env.INSTALLER_FULL == 'true'
226231
uses: actions/upload-artifact@v5
227232
with:
228233
name: coder-box-installer-${{ matrix.system }}
229-
path: ${{ steps.build.outputs.dist }}/coder-box-installer-*.iso
234+
path: |
235+
${{ steps.build.outputs.dist }}/coder-box-installer-*.iso
236+
${{ steps.build.outputs.dist }}/coder-box-installer-*.iso.sha256
230237
# Verification build; keep storage cost minimal.
231238
retention-days: 1
232239
if-no-files-found: error
233240

234-
- name: Upload installer checksum artifact
235-
if: env.INSTALLER_FULL == 'true'
236-
uses: actions/upload-artifact@v5
237-
with:
238-
name: coder-box-installer-${{ matrix.system }}-sha256
239-
path: ${{ steps.build.outputs.dist }}/coder-box-installer-*.iso.sha256
240-
retention-days: 1
241-
if-no-files-found: error
242-
243241
- name: Upload appliance ISO artifact
244242
if: env.APPLIANCE_FULL == 'true'
245243
uses: actions/upload-artifact@v5
246244
with:
247245
name: coder-box-appliance-${{ matrix.system }}
248-
path: ${{ steps.build.outputs.dist }}/coder-box-appliance-*.iso
249-
retention-days: 1
250-
if-no-files-found: error
251-
252-
- name: Upload appliance checksum artifact
253-
if: env.APPLIANCE_FULL == 'true'
254-
uses: actions/upload-artifact@v5
255-
with:
256-
name: coder-box-appliance-${{ matrix.system }}-sha256
257-
path: ${{ steps.build.outputs.dist }}/coder-box-appliance-*.iso.sha256
246+
path: |
247+
${{ steps.build.outputs.dist }}/coder-box-appliance-*.iso
248+
${{ steps.build.outputs.dist }}/coder-box-appliance-*.iso.sha256
258249
retention-days: 1
259250
if-no-files-found: error

‎Makefile‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,15 @@ define box_instantiate
153153
@echo
154154
endef
155155

156-
.PHONY: installer/iso installer/drv appliance/iso appliance/drv appliance/qcow2 appliance/raw fmt fmt/check lint lint/fix
156+
.PHONY: check installer/iso installer/drv appliance/iso appliance/drv appliance/qcow2 appliance/raw fmt fmt/check lint lint/fix
157+
158+
# ── check — flake evaluation (cheap; builds nothing) ──────────────────────────
159+
# `nix flake check --no-build --all-systems` evaluates every flake output
160+
# (nixosConfigurations, packages, …) for all declared systems, catching typos /
161+
# bad references / type errors in seconds without realising anything. --impure
162+
# matches the box_* helpers (currentSystem + the CODER_BOX_PR_* env reads).
163+
check:
164+
$(NIX) flake check $(NIX_PERF_FLAGS) --impure --no-build --all-systems
157165

158166
# installer/iso is listed first so it's the default goal (bare `make`).
159167

0 commit comments

Comments
 (0)