name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [stable]
include:
- os: ubuntu-latest
rust: '1.85.0'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Check documented crate version
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
run: python3 scripts/set-version.py --check
- name: Select Rust toolchain
run: rustup toolchain install ${{ matrix.rust }} --profile minimal && rustup default ${{ matrix.rust }}
- name: Run tests
run: cargo test --all-targets --verbose
- name: Test optional send policy
run: cargo test --all-targets --features send-policy --verbose
- name: Test RakNet proxy forwarding
run: cargo test --manifest-path examples/proxy/Cargo.toml
- name: Test proxy with optional send policy
run: cargo test --manifest-path examples/proxy/Cargo.toml --features rust-raknet/send-policy
- name: Test documentation
run: cargo test --doc
- name: Test optional send policy documentation
run: cargo test --doc --features send-policy
- name: Check examples
shell: bash
run: |
for manifest in examples/*/Cargo.toml; do
cargo check --all-targets --manifest-path "$manifest"
done
- name: Check package
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
run: cargo package --no-verify