name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 - run: rustup toolchain install 1.95.0 --profile minimal --component rustfmt --component clippy
- run: cargo fmt --check
- run: cargo clippy --locked --all-features --all-targets -- -D warnings
- run: cargo doc --locked --all-features --no-deps
env:
RUSTDOCFLAGS: -D warnings
- run: cargo doc --locked --no-default-features --no-deps
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test --locked --all-features
- run: cargo test --locked --no-default-features --features wire,local
- run: cargo test --locked --no-default-features --features wire,local,launch
- run: cargo test --locked --no-default-features --features wire
- run: cargo test --locked --no-default-features
- run: cargo run --locked --no-default-features --features wire --example application_messages
- run: cargo package --locked
protobuf:
name: Protobuf schema
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 - run: rustup toolchain install 1.95.0 --profile minimal --component rustfmt --component clippy
- run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- run: cargo fmt --manifest-path tools/proto-gen/Cargo.toml --check
- run: cargo clippy --locked --manifest-path tools/proto-gen/Cargo.toml -- -D warnings
- run: cargo run --locked --manifest-path tools/proto-gen/Cargo.toml -- --check
- run: python3 scripts/check-protobuf.py
msrv:
name: Rust 1.89
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 - run: rustup toolchain install 1.89.0 --profile minimal
- run: cargo +1.89.0 test --locked --all-features
- run: cargo +1.89.0 test --locked --no-default-features --features wire
- run: cargo +1.89.0 test --locked --no-default-features
xwin:
name: Windows cross-link (xwin)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 - run: rustup toolchain install 1.95.0 --profile minimal
- run: rustup target add x86_64-pc-windows-msvc
- run: sudo apt-get update && sudo apt-get install -y clang lld
- run: cargo install cargo-xwin --locked --version 0.23.1
- run: cargo xwin build --locked --all-features --all-targets --target x86_64-pc-windows-msvc
kani:
name: Kani proofs
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 - run: |
cargo install --locked kani-verifier --version 0.67.0
cargo kani setup
- name: Require at least one harness
run: |
cargo kani --all-features list --format json
count="$(python3 -c 'import json; print(json.load(open("kani-list.json"))["totals"]["standard-harnesses"])')"
echo "harnesses: $count"
test "$count" -ge 1
- run: cargo kani --all-features --output-format terse
loom:
name: Loom (WriterSlot)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 - run: rustup toolchain install 1.95.0 --profile minimal
- run: cargo test --release --locked --no-default-features --test loom_writer_slot
env:
RUSTFLAGS: --cfg loom
deny:
name: cargo-deny
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 - uses: EmbarkStudios/cargo-deny-action@3c6349835b2b7b196a839186cb8b78e02f7b5f25 with:
command: check