Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
pull_request:
push:
branches: [testing]
schedule:
- cron: "20 22 * * *"
# Nightly scheduling lives in sync-main-to-testing so signatures and E2E
# consistently refer to refs/heads/testing, not the default main branch.
workflow_dispatch:

permissions: {}
Expand Down
207 changes: 188 additions & 19 deletions .github/workflows/post-testing-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,204 @@ on:
workflows: ["Build Utah"]
types: [completed]
branches: [testing]
workflow_dispatch:
inputs:
build_run_id:
description: Successful Build Utah run on testing to validate
required: true
type: string

permissions: read-all
permissions: {}

concurrency:
group: utah-iso-e2e
cancel-in-progress: false

jobs:
promote-to-testing:
resolve:
if: >-
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_branch == 'testing'
runs-on: ubuntu-latest
github.event_name == 'workflow_dispatch' ||
(github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event != 'pull_request' &&
github.event.workflow_run.head_repository.full_name == github.repository)
runs-on: ubuntu-24.04
permissions:
packages: write
contents: read
actions: read
outputs:
matrix: ${{ steps.inputs.outputs.matrix }}
sha: ${{ steps.inputs.outputs.sha }}
run: ${{ steps.inputs.outputs.run }}
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
persist-credentials: false
- id: inputs
env:
GH_TOKEN: ${{ github.token }}
REPOSITORY: ${{ github.repository }}
BUILD_RUN: ${{ inputs.build_run_id || github.event.workflow_run.id }}
run: |
set -euo pipefail
[[ "$BUILD_RUN" =~ ^[0-9]+$ ]]
gh api "repos/$REPOSITORY/actions/runs/$BUILD_RUN" > run.json
gh run download "$BUILD_RUN" --repo "$REPOSITORY" \
--pattern 'image-digest-testing-*' --dir digests
matrix=$(python3 scripts/resolve-e2e-inputs.py run.json digests "$REPOSITORY")
{
echo "matrix=$matrix"
echo "sha=$(jq -r .head_sha run.json)"
echo "run=$BUILD_RUN"
} >> "$GITHUB_OUTPUT"

luks:
needs: resolve
runs-on: ubuntu-24.04
timeout-minutes: 180
permissions:
contents: read
packages: read
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.resolve.outputs.matrix) }}
steps:
- name: Download all flavor digests
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
ref: ${{ needs.resolve.outputs.sha }}
persist-credentials: false
- name: Prepare ISO and QEMU host
run: |
set -euo pipefail
# These hosted-runner SDKs are unused by ISO composition.
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo apt-get update
sudo apt-get install -y podman skopeo uidmap slirp4netns fuse-overlayfs \
squashfs-tools xorriso dosfstools mtools qemu-system-x86 qemu-utils \
ovmf sshpass ffmpeg tesseract-ocr
test -c /dev/kvm
sudo chmod a+rw /dev/kvm
test -r /dev/kvm && test -w /dev/kvm
mkdir -p output evidence
df -h .
- name: Pull exact published payload
env:
GH_TOKEN: ${{ github.token }}
run: gh run download "${{ github.event.workflow_run.id }}" --repo "${{ github.repository }}" --pattern 'image-digest-testing-*' --dir /tmp/digests
- name: Promote verified images to testing
IMAGE_REF: ${{ matrix.ref }}
run: |
set -euo pipefail
echo "$GH_TOKEN" | podman login ghcr.io -u "$GITHUB_ACTOR" --password-stdin
podman pull "$IMAGE_REF"
podman logout ghcr.io
- name: Compose disposable debug ISO
env:
IMAGE_REF: ${{ matrix.ref }}
UTAH_ISO_WORKDIR: ${{ runner.temp }}
run: |
set -euo pipefail
bash iso/scripts/build-iso.sh "$IMAGE_REF" "$PWD/output/utah-live.iso" \
"Utah CI Live" 1 "$IMAGE_REF" 2>&1 | tee evidence/iso-build.log
- name: Run existing LUKS install and desktop test
env:
IMAGE_REF: ${{ matrix.ref }}
UTAH_E2E_WORK: ${{ runner.temp }}/utah-luks-e2e
UTAH_E2E_REQUIRE_SCREENSHOTS: "1"
UTAH_E2E_REQUIRE_FASTFETCH: "1"
UTAH_E2E_RAM: "6144"
UTAH_E2E_CPUS: "2"
run: |
set -euo pipefail
bash iso/scripts/luks-e2e.sh "$PWD/output/utah-live.iso" "$IMAGE_REF" \
2>&1 | tee evidence/luks-test.log
- name: Record exact test provenance
env:
IMAGE_REF: ${{ matrix.ref }}
SOURCE_SHA: ${{ needs.resolve.outputs.sha }}
BUILD_RUN: ${{ needs.resolve.outputs.run }}
run: |
set -euo pipefail
sha256sum output/utah-live.iso > evidence/iso.sha256
jq -n --arg image "$IMAGE_REF" --arg sha "$SOURCE_SHA" \
--arg build "$BUILD_RUN" --arg run "$GITHUB_RUN_ID" \
'{image:$image,source_sha:$sha,build_run:$build,e2e_run:$run}' \
> docs/verification/provenance.json
cp evidence/iso.sha256 docs/verification/
- name: Preserve diagnostics even on failure
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: iso-diagnostics-${{ matrix.image }}
retention-days: 14
if-no-files-found: warn
path: |
evidence/
${{ runner.temp }}/utah-luks-e2e/*.log
${{ runner.temp }}/utah-luks-e2e/fastfetch-ocr.txt
${{ runner.temp }}/utah-luks-e2e/screenshots/
- name: Preserve passing verification record
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: iso-verified-${{ matrix.image }}
if-no-files-found: error
retention-days: 30
path: docs/verification/
# Never upload debug ISOs or test disks: they contain test passwords.

promote-to-testing:
needs: [resolve, luks]
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
steps:
- name: Promote only the tested digests if still current
env:
GH_TOKEN: ${{ github.token }}
REGISTRY: ghcr.io/${{ github.repository_owner }}
REPOSITORY: ${{ github.repository }}
SOURCE_SHA: ${{ needs.resolve.outputs.sha }}
MATRIX: ${{ needs.resolve.outputs.matrix }}
run: |
set -euo pipefail
echo "$GH_TOKEN" | skopeo login ghcr.io --username "${{ github.actor }}" --password-stdin
count=0
while IFS='=' read -r name digest; do
[[ -n "$name" && "$digest" == sha256:* ]] || continue
skopeo copy --all "docker://${REGISTRY}/${name}@${digest}" "docker://${REGISTRY}/${name}:testing"
count=$((count + 1))
done < <(find /tmp/digests -name '*.txt' -exec cat {} +)
test "$count" -eq 4
current=$(gh api "repos/$REPOSITORY/commits/testing" --jq .sha)
if [[ "$current" != "$SOURCE_SHA" ]]; then
echo "Superseded build: retaining evidence without moving tags."
exit 0
fi
sudo apt-get update && sudo apt-get install -y skopeo
echo "$GH_TOKEN" | skopeo login ghcr.io -u "$GITHUB_ACTOR" --password-stdin
while IFS= read -r ref; do
skopeo copy --all --preserve-digests "docker://$ref" "docker://${ref%@*}:testing"
done < <(jq -r '.include[].ref' <<< "$MATRIX")

documentation:
needs: [resolve, luks]
runs-on: ubuntu-24.04
permissions:
contents: write
pull-requests: write
actions: read
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
ref: main
- name: Download passing main-desktop screenshots
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: iso-verified-utah
path: docs/verification
- name: Refresh README evidence link
run: python3 scripts/update-e2e-readme.py
- name: Propose updated verification record
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7
with:
branch: automation/iso-verification
title: 'docs: refresh verified ISO screenshots'
commit-message: 'docs: refresh verified ISO screenshots'
body: |
Screenshots from the existing LUKS ISO test, after every configured flavor passed.
Source commit: ${{ needs.resolve.outputs.sha }}
Build: https://github.com/${{ github.repository }}/actions/runs/${{ needs.resolve.outputs.run }}
ISO E2E: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
Exact image reference and ISO checksum are in docs/verification/.
add-paths: |
README.md
docs/verification/
19 changes: 19 additions & 0 deletions .github/workflows/sync-main-to-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,31 @@ name: Sync main to testing
on:
push:
branches: [main]
paths-ignore:
- README.md
- docs/verification/**
schedule:
- cron: "20 22 * * *"
workflow_dispatch:

permissions:
contents: write
actions: write

jobs:
sync:
uses: projectbluefin/actions/.github/workflows/reusable-sync-branches.yml@eb4c546389f19ad9e42f1af052623de73c620ebb # v1
permissions:
contents: write

build:
needs: sync
runs-on: ubuntu-24.04
permissions:
actions: write
steps:
- name: Start the testing build explicitly after token-authenticated sync
env:
GH_TOKEN: ${{ github.token }}
REPOSITORY: ${{ github.repository }}
run: gh workflow run build.yml --repo "$REPOSITORY" --ref testing
5 changes: 3 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ check:
python3 -m py_compile scripts/check-repo-availability.py
python3 scripts/install-packages.py --check packages/bluefin.toml
python3 scripts/verify-rpm-contract.py --check packages/bluefin.toml
python3 -m unittest discover -s tests -p 'test_package_resolution.py'
pip install --quiet pyyaml 2>/dev/null || true
python3 -m unittest discover -s tests -p 'test_*.py'
bash -n iso/scripts/luks-e2e.sh
grep -qE 'reusable-build\.yml@(v1|[0-9a-f]{40} # v1)$' .github/workflows/build.yml
test -f Containerfile.kernel
bash -n scripts/install-ogc-kernel.sh
Expand All @@ -80,7 +82,6 @@ check:
<(grep -m1 '^ARG BASE_IMAGE=' Containerfile.kernel)
python3 -m py_compile scripts/flavors.py
python3 scripts/flavors.py list >/dev/null
pip install --quiet pyyaml 2>/dev/null || true
python3 scripts/check_workflow_outputs.py
pip install --quiet jsonschema 2>/dev/null || true
bash scripts/check-skill-frontmatter.sh
Expand Down
47 changes: 42 additions & 5 deletions docs/skills/ci-workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@ Three workflows, all thin callers into `projectbluefin/actions@v1` reusables,
each pinned to a SHA tagged `v1`:

- `.github/workflows/build.yml` -- pull requests, pushes to `testing`, a
nightly cron, and manual dispatch. Top-level `permissions: {}`; each job
manual dispatch. Top-level `permissions: {}`; each job
grants its own. Cancels in-progress runs per workflow and ref.
- `.github/workflows/promote-testing-to-main.yml` -- pushes to `testing`, a
nightly cron, and manual dispatch.
- `.github/workflows/sync-main-to-testing.yml` -- every push to `main`.
- `.github/workflows/sync-main-to-testing.yml` -- source pushes to `main`,
nightly cron, and manual dispatch; explicitly dispatches the testing build
after syncing. Token-authenticated branch pushes alone do not start CI.
- `.github/workflows/post-testing-e2e.yml` -- successful non-PR testing builds
and manual dispatch with a successful testing build run ID.

CI delegates builds, vulnerability reporting, SBOMs, keyless signatures,
provenance, caching, and rechunking to `projectbluefin/actions@v1` (originated
Expand Down Expand Up @@ -118,9 +122,42 @@ and confusingly, so this reads the same list (comment,

## sync-main-to-testing

Every push to `main` calls `reusable-sync-branches.yml@v1` (same SHA pin)
with `contents: write` and nothing else -- there is no local logic to drift
(workflow, `.github/workflows/sync-main-to-testing.yml`).
Source pushes to `main` and the nightly schedule call
`reusable-sync-branches.yml@v1`, then explicitly dispatch `build.yml` on
`testing` with `actions: write`. README/verification-only pushes are excluded
to avoid evidence-update build loops. Nightly runs still sync those changes.

## ISO LUKS gate and screenshots

`post-testing-e2e.yml` downloads the originating build's digest artifacts.
`scripts/resolve-e2e-inputs.py` rejects PRs, foreign repositories, failed runs,
wrong branches/workflows, mutable references, conflicting digests, and missing
flavors. The expected set comes from `scripts/flavors.py images`.

Each configured image is pulled by digest, composed into a disposable debug
ISO, and passed to the existing `iso/scripts/luks-e2e.sh`. Both guests have
restricted networking. CI requires KVM, PNG screenshots, and OCR evidence
that fastfetch ran in the graphical terminal. Test credentials are confined
to the disposable ISO/disk; neither is uploaded or released.

Every matrix job preserves build/test logs, serial logs, and screenshots,
including on failure. Only passing jobs upload `docs/verification` with the
source commit, original build run, E2E run, image digest and ISO checksum.
The promotion job depends on the entire matrix; a superseded testing commit
cannot move tags. Registry tag copies are sequential, not an atomic multi-tag
transaction: a registry failure can interrupt promotion after a partial copy.

A separate least-privilege job proposes the main desktop's screenshots in
`automation/iso-verification`, a documentation PR. It updates only the README
evidence block and `docs/verification/`, preserving the current README's other
content. The repository must allow Actions to create pull requests; a denied
write fails this job visibly, without deleting test artifacts. It does not
auto-merge the evidence PR or imply a fresh pass for a different commit.

For a deliberate rerun, dispatch Post-Testing E2E with `build_run_id` from a
successful testing build containing the current harness. Do not pass a PR
build: PRs do not publish immutable images. This matrix validates emulated
UEFI desktop installation, not Secure Boot, TPM unlock, or physical GPUs.

## Verification

Expand Down
14 changes: 11 additions & 3 deletions docs/skills/local-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,17 @@ accounts and requires local QEMU/KVM access, not a production installation.
Passing runs refresh `docs/verification/README.md`, its screenshots, and the
delimited verification block in the root README. These are historical local
test records, not proof that the current commit passed CI. In particular,
the fastfetch capture currently waits after terminal autostart; it does not
independently assert that fastfetch rendered. Automated CI publication still
needs to be wired up and must retain the tested commit/image digest.
local fastfetch capture waits after terminal autostart by default. CI sets
`UTAH_E2E_REQUIRE_FASTFETCH=1` to require OCR of its completion marker and
kernel output, and `UTAH_E2E_REQUIRE_SCREENSHOTS=1` to reject missing PNGs.
CI retains the tested commit/image digest and proposes evidence updates in a
documentation PR only after all flavors pass. See [ci-workflows.md](ci-workflows.md).

The harness blocks outbound guest networking while retaining loopback-only
SSH forwards, so installation cannot silently fall back to an online pull.
It enables sshd through a boot argument on the disposable installed disk,
never by rebuilding or changing the published image. `UTAH_E2E_RAM` and
`UTAH_E2E_CPUS` control VM resources (defaults 8192 MiB and four CPUs).

When integrating this harness with newer image-build fixes, retain the
currently verified package-image digest and available-package contract.
Expand Down
Loading
Loading