Skip to content

Update getrandom requirement from 0.3 to 0.4 #11

Update getrandom requirement from 0.3 to 0.4

Update getrandom requirement from 0.3 to 0.4 #11

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: [stable]
include:
- os: ubuntu-latest
rust: beta
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v2
- run: cargo build --all-targets
- run: cargo test
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable && rustup component add rustfmt clippy
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --check
- run: cargo clippy --all-targets -- -D warnings
docs:
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -D warnings
steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable
- uses: Swatinem/rust-cache@v2
- run: cargo doc --no-deps
# the minimum supported Rust version declared in Cargo.toml actually builds the crate
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install 1.85 --profile minimal && rustup default 1.85
- uses: Swatinem/rust-cache@v2
- run: cargo check
# dependency advisories, licenses and sources
deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
# binary compatibility: live interoperability against the reference C implementation.
# the wire format itself is locked byte-for-byte by the golden vector tests in
# src/wire_compat.rs, which run in every `cargo test` leg above.
interop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: mas-bandwidth/netcode
path: netcode-c
- run: rustup update stable && rustup default stable
- uses: Swatinem/rust-cache@v2
- name: build the C reference client and server
run: |
cmake -S netcode-c -B netcode-c/build -DCMAKE_BUILD_TYPE=Release
cmake --build netcode-c/build --parallel --target client server
- name: run interoperability tests
env:
NETCODE_C_SERVER: ${{ github.workspace }}/netcode-c/build/bin/server
NETCODE_C_CLIENT: ${{ github.workspace }}/netcode-c/build/bin/client
run: cargo test --test c_interop -- --ignored --test-threads=1 --nocapture
# bounded smoke fuzz of the untrusted input surface; the scheduled workflow fuzzes longer
fuzz:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install nightly --profile minimal && rustup default nightly
- uses: taiki-e/install-action@v2
with:
tool: cargo-fuzz
- uses: Swatinem/rust-cache@v2
with:
workspaces: fuzz
- name: smoke fuzz each target
run: |
# the prebuilt cargo-fuzz defaults to its own (musl) build target, which is
# incompatible with the address sanitizer: always fuzz the host triple
host=$(rustc -vV | sed -n 's/host: //p')
for target in $(cargo fuzz list); do
cargo fuzz run "$target" --target "$host" -- -max_total_time=30
done