GitCorner

Code

ossartcraftphotocraft🌐
856f865cf98d
# 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.
# It then runs packaging/freebsd/package.sh, the script the release job runs, and checks the
# tarball, so a broken FreeBSD package fails here before it can fail a release. Nothing is
# uploaded and no secrets are used.
name: FreeBSD

# The VM build takes one to several hours, so it runs nightly on main rather than on every push
# or dependency change: a drifted dependency still shows up within a day. PRs that change the
# FreeBSD packaging itself still run it.
# Nightly and on demand only: FreeBSD never runs on pull requests or pushes and never blocks a release.
on:
  schedule:
    - cron: "17 2 * * *"
  workflow_dispatch:

concurrency:
  group: freebsd-${{ github.ref }}
  cancel-in-progress: true

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:
      craft-fonts-ref: cc9269cd8d8258785dac603fba3122e5d2556795
      # Build every target with the profile the tests use. Plain `cargo build --all-targets` builds
      # test targets with the dev profile, so ui-egui's lib tests (about 390k lines, 7700 tests)
      # were compiled at opt-level 1 rather than Cargo.toml's test-profile opt-level 0, and that
      # rustc ran the 12 GB guest out of memory (SIGKILL, nightly and dispatched runs on both
      # legs).
      cargo-build-extra-args: "--features heif --profile test"
      # The test commands reuse that build only if they resolve the same features. `-p
      # photocraft-ui-egui` (or `--exclude photocraft-ui-egui`) leaves out the other members'
      # feature requests, so egui, epaint and the crates above them got new hashes and the test
      # step rebuilt ui-egui's lib tests, where that rustc was SIGKILLed again. So ui-egui is
      # tested with the build's selection, `--workspace --features heif`. Excluding
      # photocraft-gpu leaves the resolution unchanged; its own command rebuilds only its graph.
      # The VM's software Vulkan driver crashes (SIGSEGV) when several tests set up a device at
      # once, so photocraft-gpu's tests and the integration tests (ui-egui's among them; one
      # command runs them all) run one at a time.
      custom-test-command: "CARGO_PROFILE_DEV_DEBUG=0 cargo test --workspace --locked --features heif --exclude photocraft-gpu --lib --bins && CARGO_PROFILE_DEV_DEBUG=0 cargo test --workspace --locked --features heif --exclude photocraft-gpu --doc && CARGO_PROFILE_DEV_DEBUG=0 cargo test --workspace --locked --features heif --exclude photocraft-gpu --test '*' -- --test-threads=1 && CARGO_PROFILE_DEV_DEBUG=0 cargo test -p photocraft-gpu --locked -- --test-threads=1"
      run-package-check: true