Files
effectcraft/.github/workflows/freebsd.yml
FredAppsandFredrik Hallin 163eb89477 ci: isolate FreeBSD tests to release retained UI memory (#4228)
* ci: serialize FreeBSD tests to bound concurrent render memory

* Isolate FreeBSD tests in fresh processes to release retained UI state

---------

Co-authored-by: Fredrik Hallin <[email protected]>
2026-11-28 11:12:41 +01:00

50 lines
2.2 KiB
YAML

# Builds and tests the workspace on FreeBSD, inside a FreeBSD VM on a Linux runner
# (GitHub has no FreeBSD runners). GPU tests skip themselves when the VM has no adapter.
name: FreeBSD
# The VM build is slow, so it runs nightly on main and on pushes to `release`, not on every pull
# request: a drifted dependency still shows up within a day, and always before a release ships.
# PRs that change the FreeBSD workflow or packaging itself still run it.
on:
push:
branches: [release]
pull_request:
paths:
- .github/workflows/freebsd.yml
- packaging/freebsd/**
- packaging/env.sh
schedule:
- cron: "47 2 * * *"
workflow_dispatch:
concurrency:
group: freebsd-${{ github.ref }}
# A push to main doesn't cancel the run in progress (the newest waiting run replaces older ones),
# so main gets complete runs however often it moves; PR pushes do cancel.
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
freebsd:
# Intentionally tracked at @main (not SHA-pinned) so org-wide CI improvements, security fixes, and build optimizations propagate without PR churn across all craftapp repos.
uses: storytold/craft-common-actions/.github/workflows/freebsd.yml@main
with:
# Serial libtest still accumulates UI process state until the VM runs out of RAM.
# Keep every test, but release process-owned caches after each one, as the main gate does.
custom-test-command: |
export CARGO_PROFILE_DEV_DEBUG=0
nextest_dir=$(mktemp -d)
curl -fLsS --retry 3 -o "$nextest_dir/nextest.tar.gz" https://github.com/nextest-rs/nextest/releases/download/cargo-nextest-0.9.150/cargo-nextest-0.9.150-x86_64-unknown-freebsd.tar.gz
if [ "$(sha256 -q "$nextest_dir/nextest.tar.gz")" != 7f75971eb6e0d44dfa76e75a936b438140e69292793d630e6c02331a9c6b3c31 ]; then
echo 'error: cargo-nextest archive checksum mismatch' >&2
exit 1
fi
tar -xzf "$nextest_dir/nextest.tar.gz" -C "$nextest_dir"
export PATH="$nextest_dir:$PATH"
failed=0
cargo nextest run --workspace --locked --no-fail-fast --test-threads=1 || failed=1
cargo test --workspace --locked --doc --no-fail-fast || failed=1
exit "$failed"