mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-02 13:15:17 +09:00
Issue #101 shipped because release.yml went straight from `build` to `push` with nothing in between. The image was missing scripts/, so every containerised panel 404'd its own enrollment URL, while the entire test suite stayed green -- pytest runs against the source tree, where the file always exists. Only booting the artifact catches that class of bug. scripts/test/smoke-docker-image.sh builds (or takes) an image, asserts the files the panel reads at request time are present, boots it, and requests every route that serves a file off disk. release.yml now builds amd64, runs it, and only then pushes multi-arch (layers are cached, so the push reuses the build). release-smoke.yml gets the same job on dev and PRs, and its path filters now include Dockerfile, .dockerignore and scripts/ -- none of which used to trigger it. scripts/test/verify-agent-release-chain.sh covers the other half, which unit tests structurally cannot: they stub curl, so they only ever prove the installer is self-consistent, never that the URL it builds resolves to a real file. This one reads the coordinates back out of the script, asks GitHub, downloads the archive, verifies the checksum and confirms the tarball entry name the installer moves. It runs nightly, and is also the tripwire for the reverse case -- the agent repo changing its release naming and breaking the panel from the other side of the repo split. Both are plain scripts so the same check runs locally: bash scripts/test/smoke-docker-image.sh bash scripts/test/verify-agent-release-chain.sh Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
86 lines
2.6 KiB
YAML
86 lines
2.6 KiB
YAML
name: Release Build Smoke Test
|
|
|
|
# Validates that the release tarball can be built successfully. This catches
|
|
# release-script-specific issues (e.g. overly broad rsync excludes that omit
|
|
# frontend source files) before they reach main, instead of failing late in the
|
|
# release workflow.
|
|
|
|
# main is deliberately absent from `push`: on a merge to main, release.yml's
|
|
# `build-release` job runs this very script for real moments later, so building
|
|
# the tarball here too was pure duplication.
|
|
on:
|
|
push:
|
|
branches: [dev]
|
|
paths:
|
|
- 'frontend/**'
|
|
- 'backend/**'
|
|
- 'scripts/**'
|
|
- 'Dockerfile'
|
|
- '.dockerignore'
|
|
- '.github/workflows/release-smoke.yml'
|
|
- '.github/workflows/release.yml'
|
|
- 'VERSION'
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- 'frontend/**'
|
|
- 'backend/**'
|
|
- 'scripts/**'
|
|
- 'Dockerfile'
|
|
- '.dockerignore'
|
|
- '.github/workflows/release-smoke.yml'
|
|
- '.github/workflows/release.yml'
|
|
- 'VERSION'
|
|
|
|
jobs:
|
|
build-release-smoke:
|
|
name: Build release tarball
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Install build dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y python3-venv python3-pip rsync
|
|
|
|
- name: Run release build script
|
|
run: bash scripts/build-release.sh
|
|
|
|
# The tarball job above proves the *source* packaging. This one proves the
|
|
# *image* packaging, which is a different artifact with a different file list
|
|
# -- and the one that shipped issue #101 (the panel serves scripts/install.sh
|
|
# off its own disk; the Dockerfile never copied it, so every containerised
|
|
# panel 404'd the enrollment URL its own UI prints). Booting the image is the
|
|
# only check that sees it: pytest runs against the source tree, where the file
|
|
# is always present.
|
|
docker-image-smoke:
|
|
name: Boot the Docker image
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build image (amd64)
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64
|
|
push: false
|
|
load: true
|
|
tags: serverkit:smoke
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|
|
- name: Smoke test the built image
|
|
run: SKIP_BUILD=1 bash scripts/test/smoke-docker-image.sh serverkit:smoke
|