name: CI
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUSTDOCFLAGS: -D warnings
jobs:
quality:
name: fmt, clippy, test, docs (ubuntu)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install preview test tooling
run: |
set -euxo pipefail
sudo apt-get update
sudo apt-get install -y \
ffmpeg \
genisoimage \
imagemagick \
libarchive-tools \
poppler-utils \
xz-utils
if ! command -v 7z >/dev/null 2>&1; then
if sudo apt-get install -y p7zip-full; then
:
else
sudo apt-get install -y 7zip
if command -v 7zz >/dev/null 2>&1 && ! command -v 7z >/dev/null 2>&1; then
sudo ln -s "$(command -v 7zz)" /usr/local/bin/7z
fi
fi
fi
- name: Install Rust 1.93.0
uses: dtolnay/rust-toolchain@1.93.0
with:
components: rustfmt, clippy
- name: Cache Rust build artifacts
uses: Swatinem/rust-cache@v2
with:
cache-bin: false
- name: cargo fmt --check
run: cargo fmt --check
- name: cargo test --locked --test architecture_guardrails
run: cargo test --locked --test architecture_guardrails
- name: cargo clippy --locked --all-targets -- -D warnings
run: cargo clippy --locked --all-targets -- -D warnings
- name: cargo test --locked
run: cargo test --locked
- name: cargo doc --locked --no-deps
run: cargo doc --locked --no-deps
macos-build:
name: build and test (macOS)
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install preview test tooling
run: |
set -euxo pipefail
brew install ffmpeg imagemagick poppler sevenzip cdrtools
if ! command -v 7z >/dev/null 2>&1 && command -v 7zz >/dev/null 2>&1; then
ln -sf "$(command -v 7zz)" /usr/local/bin/7z
fi
# genisoimage is Linux-specific; mkisofs from cdrtools is a compatible drop-in
if ! command -v genisoimage >/dev/null 2>&1 && command -v mkisofs >/dev/null 2>&1; then
ln -sf "$(command -v mkisofs)" /usr/local/bin/genisoimage
fi
- name: Install Rust 1.93.0
uses: dtolnay/rust-toolchain@1.93.0
- name: Cache Rust build artifacts
uses: Swatinem/rust-cache@v2
with:
cache-bin: false
- name: cargo build --locked
run: cargo build --locked
- name: cargo test --locked
run: cargo test --locked
windows-build:
name: build and test (Windows)
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install Rust 1.93.0
uses: dtolnay/rust-toolchain@1.93.0
- name: Cache Rust build artifacts
uses: Swatinem/rust-cache@v2
with:
cache-bin: false
- name: cargo build --locked
run: cargo build --locked
- name: cargo test --locked
run: cargo test --locked
freebsd-build:
name: build and test (FreeBSD)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Build and test on FreeBSD
uses: vmactions/freebsd-vm@v1
with:
release: "14.4"
usesh: true
prepare: |
env ASSUME_ALWAYS_YES=yes pkg bootstrap -f
pkg update -f
pkg install -y rust 7-zip
# Some FreeBSD package versions ship 7zz only; keep a 7z fallback for elio's archive preview.
if [ ! -x /usr/local/bin/7z ] && [ -x /usr/local/bin/7zz ]; then
ln -sf /usr/local/bin/7zz /usr/local/bin/7z
fi
run: |
cargo build --locked
cargo test --locked