8000 ci: flip every lane to always-trigger with in-workflow gates by norrietaylor · Pull Request #712 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
42 changes: 0 additions & 42 deletions .github/workflows/ci-docs-skip.yml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/ci-gvproxy.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/ci-linux-kvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ jobs:
# it post-merge.
- ".github/actions/setup-libkrun-linux/**"
- ".github/actions/materialize/**"
# The gvproxy pin: point-of-use verification (fetch-gvproxy.sh
# SHA-checks it in this lane) replaced the retired ci-gvproxy.yml
# workflow, so a pin bump must re-run this lane.
- "vendor/gvproxy/**"

build-linux:
# BUILD phase: compile everything the KVM tests need and ship it as one
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-linux-native.yml
< 10000 /tr>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: CI (Linux native)
# (dorny/paths-filter) gates the expensive jobs, and the `if: always()`
# aggregator reports success even when they were path-skipped. This is the
# lane pattern that will replace the ci-docs-skip.yml inverse-path hack once
# the aggregators become the required checks (#687): a required context that
# the aggregators become the required checks: a required context that
# a trigger-level path filter skips stays "Expected" forever and wedges the
# PR, while a skipped in-workflow job just reports `skipped`, which the
# aggregator treats as pass. Do NOT add trigger-level `paths:` here.
Expand Down Expand Up @@ -75,9 +75,9 @@ jobs:
tests:
# Core workspace suite (nextest + doctests), taking over ci.yml's `test`
# job for this lane; ci.yml keeps its copy until the ruleset requires
# this lane's aggregator (#687), then drops it.
# this lane's aggregator, then drops it.
#
# MOTHBALLED, deliberately absent (owner decision, #687): the
# MOTHBALLED, deliberately absent (owner decision): the
# `--features networking-proxy` (mTLS reverse proxy) and `--features
# networking-wg` (WireGuard mesh) test steps that ci.yml's `test` job
# still carries, and the netns/mesh namespace proofs that ci-netns.yml
Expand Down
133 changes: 82 additions & 51 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,18 @@
name: CI (macOS)

# Split from ci.yml so it can be PATH-SCOPED: the single self-hosted Apple
# Silicon runner (`jks-Mac-mini`) is a shared bottleneck, so only run it when
# the macOS-relevant surface changes. Most PRs touch no minvmd code and skip
# this workflow entirely, keeping the runner free.
# The macOS/HVF target lane. ALWAYS-TRIGGERED, path-scoped INSIDE the
# workflow: the `changes` job gates the expensive jobs — the single
# self-hosted Apple Silicon runner (`jks-Mac-mini`) is a shared bottleneck,
# so the hypervisor e2e only runs when the macOS-relevant surface changes —
# and the `if: always()` aggregator (ci-macos-success) reports success even
# when the jobs were path-skipped, so the context can join the required
# checks. A required context that a trigger-level path filter skips stays
# "Expected" forever and wedges the PR; do NOT add trigger-level `paths:`.
on:
push:
branches: ["main"]
paths:
- "crates/minvmd/**"
- "crates/minimald/**" # guest daemon: runs as pid-1 in the e2e/boot VM
- "crates/minimal/**"
- "crates/sessions/**" # platform-sensitive: canonicalization, symlinks
- "Cargo.toml"
- "Cargo.lock"
# The toolchain pin: a rustc bump must re-run the Rust lanes.
- "rust-toolchain.toml"
- ".github/workflows/ci-macos.yml"
- "scripts/**"
# Composite actions this lane's setup runs through — without these,
# a composite-only edit would skip this lane and break it post-merge.
- ".github/actions/setup-libkrun-macos/**"
- ".github/actions/materialize/**"
# The libkrun pin: a bump must rebuild + re-run the hypervisor e2e.
- "vendor/libkrun/**"
pull_request:
branches: ["main"]
paths:
- "crates/minvmd/**"
- "crates/minimald/**" # guest daemon: runs as pid-1 in the e2e/boot VM
- "crates/minimal/**"
- "crates/sessions/**" # platform-sensitive: canonicalization, symlinks
- "Cargo.toml"
- "Cargo.lock"
# The toolchain pin: a rustc bump must re-run the Rust lanes.
- "rust-toolchain.toml"
- ".github/workflows/ci-macos.yml"
- "scripts/**"
# Composite actions this lane's setup runs through — without these,
# a composite-only edit would skip this lane and break it post-merge.
- ".github/actions/setup-libkrun-macos/**"
- ".github/actions/materialize/**"
# The libkrun pin: a bump must rebuild + re-run the hypervisor e2e.
- "vendor/libkrun/**"
workflow_dispatch:

env:
Expand All @@ -56,9 +26,51 @@ concurrency:
# Least privilege: this workflow only checks out and builds.
permissions:
contents: read
# dorny/paths-filter reads the PR file list on pull_request events.
pull-requests: read

jobs:
changes:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
macos: ${{ steps.filter.outputs.macos }}
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Detect macOS-relevant changes
id: filter
# v3.0.2, SHA-pinned. Runs ONLY on pull_request, where dorny
# reads the PR file list via the API (a push would need a local
# diff our shallow, credential-free checkout cannot provide) —
# and pushes to main / dispatches run everything regardless.
if: github.event_name == 'pull_request'
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
8000 with:
filters: |
macos:
- "crates/minvmd/**"
- "crates/minimald/**" # guest daemon: pid-1 in the e2e/boot VM
- "crates/minimal/**"
- "crates/sessions/**" # platform-sensitive: canonicalization, symlinks
- "Cargo.toml"
- "Cargo.lock"
# The toolchain pin: a rustc bump must re-run the Rust lanes.
- "rust-toolchain.toml"
- ".github/workflows/ci-macos.yml"
- "scripts/**"
# Composite actions this lane's setup runs through — without
# these, a composite-only edit would skip this lane and
# break it post-merge.
- ".github/actions/setup-libkrun-macos/**"
- ".github/actions/materialize/**"
# The libkrun pin: a bump must rebuild + re-run the e2e.
- "vendor/libkrun/**"

artifacts:
needs: [changes]
if: github.event_name != 'pull_request' || needs.changes.outputs.macos == 'true'
# Build the `minimal` CLI from THIS repo's sources, then materialize the
# guest kernel + rootfs against the repo's own .minimal/minimal.toml. Both
# are cache pulls keyed by the pinned upstream commit (not compiles): the
Expand Down Expand Up @@ -165,12 +177,15 @@ jobs:
# boots the same kernel/rootfs/initramfs through the same HVF path as the
# retired standalone boot test and goes further (russh auth + exec,
# stdout + exit status), so a passing session gates the boot. The
# unified session e2e (scripts/session-e2e.sh) then covers the R4.5
# unified session e2e (scripts/session-e2e.sh) then covers the
# CLI proof and more: from a clean state `minimal activate` must
# auto-spawn minvmd and a real session exec must round-trip — the
# macOS integration gate that no unit test can cover.
if: ${{ vars.RUN_MACOS_CI != 'false' }}
needs: [artifacts]
# RUN_MACOS_CI is the kill-switch repo variable for taking the mini
# offline; a skipped e2e reads as `skipped`, which the aggregator
# treats as pass.
if: ${{ vars.RUN_MACOS_CI != 'false' && (github.event_name != 'pull_request' || needs.changes.outputs.macos == 'true') }}
needs: [changes, artifacts]
runs-on: [self-hosted, macOS, ARM64]
timeout-minutes: 30
env:
Expand Down Expand Up @@ -232,7 +247,7 @@ jobs:
printf '%s\n' "$bad" >&2
exit 1
fi
- name: Codesign minvmd (hypervisor entitlement, R1.4)
- name: Codesign minvmd (hypervisor entitlement)
run: codesign --entitlements crates/minvmd/minvmd.entitlements --force -s - target/debug/minvmd
- name: Production linkage static check (rewrite on a copy)
# Run the release pipeline's @rpath rewrite + verification against a
Expand Down Expand Up @@ -277,17 +292,16 @@ jobs:
# The session harness (Guest::drop) kills its minvmd but not the
# rest of the process tree it spawned: the detached `__krun-vmm`
# grandchild AND the host gvproxy switch minvmd owns. Either
# leftover wedges the host→guest bridge over libkrun's vsock
# (#588) — a healthy guest accept loop that never receives the
# bridged connection — so the CLI e2e's cold activate dies with
# leftover wedges the host→guest bridge over libkrun's vsock —
# a healthy guest accept loop that never receives the bridged
# connection — so the CLI e2e's cold activate dies with
# `ssh connect: Disconnected`. The `__krun-vmm`-only reap proved
# insufficient: main run 29032763009 (on the commit that added
# it) failed exactly this way, with the new VM's proxy-publish
# WARN pointing at a lingering gvproxy. Reap the whole tree —
# any stray minvmd first (so nothing respawns), then the VMM and
# insufficient on a main run: the new VM's proxy-publish WARN
# pointed at a lingering gvproxy. Reap the whole tree — any
# stray minvmd first (so nothing respawns), then the VMM and
# gvproxy — so the CLI e2e starts from the single-VM state it
# had when it was its own job. The proper fix (harness reaps its own
# process group) is tracked under #588.
# had when it was its own job. The proper fix is for the harness
# to reap its own process group, tracked separately.
run: |
pkill -x minvmd 2>/dev/null || true
pkill -f '__krun-vmm' 2>/dev/null || true
Expand Down Expand Up @@ -335,6 +349,8 @@ jobs:
# self-hosted runner, which this job frees up for exactly that. Scoped
# to the macOS-sensitive crates; widen to --workspace once the tree is
# mac-buildable. Kept lean (private repo: macOS minutes bill at 10x).
needs: [changes]
if: github.event_name != 'pull_request' || needs.changes.outputs.macos == 'true'
runs-on: macos-latest
timeout-minutes: 45
env:
Expand Down Expand Up @@ -376,3 +392,18 @@ jobs:
# coverage stays the autospawn e2e until minimald's sandbox deps
# are cfg(linux)-gated.
run: cargo test -p sessions --locked

# Single required status check for this lane (branch-protection context:
# ci-macos-success). Green when every gating job succeeded OR was
# path-skipped (or the RUN_MACOS_CI kill-switch skipped the e2e); red only
# on failure/cancellation.
ci-macos-success:
if: always()
needs: [changes, artifacts, e2e, unit]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Verify all gating jobs succeeded or were skipped
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1
- run: echo "macOS lane green"
Loading
Loading
0