Files
swaits 66a2484aeb ci: update fuzz target list to the v2 names
The Fuzz workflow step was still iterating the old v0.1 target names (parse_radio_config, cobs_decoder_feed, cobs_roundtrip, command_roundtrip, cobs_decoder_multi_frame, cobs_chunk_invariant). After the Protocol v2 rewrite only five targets exist: decoder_feed, frame_roundtrip, lora_config_roundtrip, parse_command, parse_device_message. Update the workflow to match.
2026-04-22 10:33:06 -06:00

165 lines
4.7 KiB
YAML

name: CI
on:
push:
branches: [main, dev]
pull_request:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
test:
name: Test (${{ matrix.features }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
features:
- default
- no-default-features
- all-features
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@v2
with:
tool: nextest
- name: cargo nextest run
run: |
case "${{ matrix.features }}" in
default) cargo nextest run ;;
no-default-features) cargo nextest run --no-default-features ;;
all-features) cargo nextest run --all-features ;;
esac
- name: cargo test --doc
run: cargo test --doc
clippy:
name: Clippy (${{ matrix.features }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
features:
- default
- no-default-features
- all-features
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: cargo clippy
run: |
case "${{ matrix.features }}" in
default) cargo clippy --all-targets -- -D warnings ;;
no-default-features) cargo clippy --all-targets --no-default-features -- -D warnings ;;
all-features) cargo clippy --all-targets --all-features -- -D warnings ;;
esac
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt -- --check
doc:
name: Doc
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -D warnings
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo doc --no-deps --all-features
deny:
name: Cargo Deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
miri:
name: Miri
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: miri
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@v2
with:
tool: nextest
- run: cargo +nightly miri nextest run --lib --test vectors
- run: cargo +nightly miri nextest run --lib --test vectors --no-default-features
fuzz:
name: Fuzz (60s per target)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
fuzz
- uses: taiki-e/install-action@v2
with:
tool: cargo-fuzz
- name: Build fuzz targets
working-directory: fuzz
# Pin to the gnu target — cargo-fuzz defaults to musl for ASAN
# static linking, but the nightly toolchain we install doesn't
# ship a musl std.
run: cargo +nightly fuzz build --target x86_64-unknown-linux-gnu
- name: Smoke-run every target
working-directory: fuzz
run: |
for target in decoder_feed frame_roundtrip lora_config_roundtrip parse_command parse_device_message; do
echo "── $target ──"
cargo +nightly fuzz run "$target" --target x86_64-unknown-linux-gnu -- -max_total_time=60
done
mutants:
name: Mutants
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
features:
- default
- no-default-features
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@v2
with:
tool: cargo-mutants, nextest
- name: cargo mutants (${{ matrix.features }})
run: |
extra=""
[ "${{ matrix.features }}" = "no-default-features" ] && extra="--no-default-features"
cargo mutants --no-shuffle --test-tool=nextest $extra \
-E 'replace > with >= in Command::from_bytes' \
-E 'replace > with >= in CobsDecoder::feed' \
-E 'replace < with <= in cobs_encode_response'
- name: Upload mutants.out on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: mutants-${{ matrix.features }}
path: mutants.out