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
3 changes: 3 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# NOTE: The required version should be in sync with the version pinned in
# .github/buildomat/jobs/build-and-test.sh.
nextest-version = { required = "0.9.143", recommended = "0.9.143" }
32 changes: 32 additions & 0 deletions .github/buildomat/jobs/build-and-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
#:
#: name = "build-and-test / illumos"
#: variety = "basic"
#: target = "helios"
#: rust_toolchain = "stable"
#:

set -o errexit
set -o pipefail
set -o xtrace

rustup show active-toolchain || rustup toolchain install

cargo --version
rustc --version

# The helios image does not ship nextest. Fetch the prebuilt binary rather
# than cargo install it, since compiling nextest would dominate a job whose
# test suite runs in under a second; omicron's buildomat jobs do the same.
NEXTEST_VERSION='0.9.143'
curl -sSfL --retry 10 "https://get.nexte.st/$NEXTEST_VERSION/illumos" | gunzip | tar -xf - -C ~/.cargo/bin

banner build
ptime -m cargo build --all-features --locked --all-targets --verbose

banner test
ptime -m cargo nextest run --all-features --locked

# nextest does not run doctests.
banner doctest
ptime -m cargo test --all-features --locked --doc
4 changes: 0 additions & 4 deletions .github/renovate.json

This file was deleted.

108 changes: 85 additions & 23 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,104 @@ name: Rust
on:
push:
branches: [main]
# No base-branch filter: a pull request may target another pull request's
# branch, and those need checks too.
pull_request:
branches: [main]

env:
RUSTFLAGS: -D warnings

jobs:
check-style:
lint:
name: Lint
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -D warnings
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- name: Report cargo version
run: cargo --version
- name: Report rustfmt version
run: cargo fmt -- --version
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
- uses: taiki-e/install-action@e67fa11c4b9316fa714ddf0abed07a0c3143b95b # v2.87.4
with:
tool: cargo-hack
- name: Report versions
run: |
cargo --version
cargo fmt -- --version
cargo clippy --version
- name: Check style
run: cargo fmt -- --check
# The powerset covers combinations the all-features and default builds
# miss, such as a type whose schema only compiles when serde happens to
# be on as well.
- name: Lint (clippy)
run: cargo hack --feature-powerset clippy --all-targets --locked
- name: Build documentation
run: cargo doc --all-features --no-deps --locked

# Feature-combo compile coverage lives in the lint job, where clippy
# runs over the powerset. This job just runs tests across all/default/none
# feature selections.
#
# Note: illumos, where oxnet's in-kernel and switch consumers run, is covered
# by buildomat (.github/buildomat/jobs), not by a GitHub runner.
build-and-test:
name: Build and test (${{ matrix.os }}, ${{ matrix.features || 'default' }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
Comment thread
ahl marked this conversation as resolved.
# 1.88 is the MSRV
rust-version: [stable, "1.88"]
features: [all, default]
include:
- features: all
feature_flags: --all-features
os: [ubuntu-latest, macos-latest, windows-latest]
features: ["", "--all-features", "--no-default-features"]
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- uses: dtolnay/rust-toolchain@v1
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
key: ${{ matrix.features }}
- uses: taiki-e/install-action@e67fa11c4b9316fa714ddf0abed07a0c3143b95b # v2.87.4
with:
tool: nextest
- name: Report versions
run: |
cargo --version
rustc --version
- name: Build
run: cargo build ${{ matrix.features }} --all-targets --locked --verbose
- name: Run tests
run: cargo nextest run ${{ matrix.features }} --locked
# nextest does not run doctests, so they need a pass of their own.
- name: Run doctests
run: cargo test ${{ matrix.features }} --doc --locked --verbose

build-and-test-msrv:
name: Build and test (MSRV)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
features: ["", "--all-features", "--no-default-features"]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: dtolnay/rust-toolchain@master
with:
# Keep in step with rust-version in Cargo.toml.
toolchain: "1.88"
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
key: msrv-${{ matrix.features }}
- uses: taiki-e/install-action@e67fa11c4b9316fa714ddf0abed07a0c3143b95b # v2.87.4
with:
toolchain: ${{ matrix.rust-version }}
- name: Report cargo version
run: cargo --version
- name: Report rustc version
run: rustc --version
tool: nextest
- name: Report versions
run: |
cargo --version
rustc --version
- name: Build
run: cargo build ${{ matrix.feature_flags }} --locked --all-targets --verbose
run: cargo build ${{ matrix.features }} --all-targets --locked --verbose
- name: Run tests
run: cargo test ${{ matrix.feature_flags }} --locked --all-targets --verbose
run: cargo nextest run ${{ matrix.features }} --locked
- name: Run doctests
run: cargo test ${{ matrix.features }} --doc --locked --verbose