Skip to content

Add cross-compilation in CI #338

Add cross-compilation in CI

Add cross-compilation in CI #338

name: Checks and tests
on: [push, pull_request]
jobs:
check_and_test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
toolchain: ["1.75.0", nightly]
name: ${{ matrix.toolchain }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
RUSTFLAGS: --cfg ci
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Install Rust
run: |
rustup toolchain install ${{ matrix.toolchain }} --profile minimal --component clippy --no-self-update
rustup default ${{ matrix.toolchain }}
- name: Run Clippy for default configuration
run: cargo clippy -- -A unknown_lints
- name: Run tests for default configuration
run: cargo test
- name: Run rustdoc for default configuration
run: cargo doc --no-deps
- name: Run Clippy for Tokio configuration
run: cargo clippy --features tokio -- -A unknown_lints
- name: Run tests for Tokio configuration
run: cargo test --features tokio
- name: Run rustdoc for Tokio configuration
run: cargo doc --features tokio --no-deps
xcompile:
strategy:
fail-fast: false
matrix:
target: [aarch64-linux-android, x86_64-unknown-freebsd]
toolchain: ["1.75.0", nightly]
name: ${{ matrix.toolchain }} on ${{ matrix.target }} (no tests)
runs-on: ubuntu-latest
env:
RUSTFLAGS: --cfg ci
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Install Rust
run: |
rustup toolchain install ${{ matrix.toolchain }} --profile minimal --component clippy --no-self-update
rustup default ${{ matrix.toolchain }}
rustup target add ${{ matrix.target }}
- name: Run Clippy for default configuration
run: cargo clippy --target ${{ matrix.target }} -- -A unknown_lints
- name: Run rustdoc for default configuration
run: cargo doc --target ${{ matrix.target }} --no-deps
- name: Run Clippy for Tokio configuration
run: cargo clippy --target ${{ matrix.target }} --features tokio -- -A unknown_lints
- name: Run rustdoc for Tokio configuration
run: cargo doc --target ${{ matrix.target }} --features tokio --no-deps