name: CI
on:
push:
branches-ignore: [
"renovate/**",
"gh-readonly-queue/**",
]
pull_request:
env:
RUSTFLAGS: -D warnings
RUSTDOCFLAGS: -D warnings
CI_RUST_VERSION: "1.85"
MSRV: "1.65"
jobs:
build:
timeout-minutes: 5
strategy:
matrix:
include:
- name: "stable wasm"
os: "ubuntu-latest"
target: "wasm32-unknown-unknown"
- name: "stable linux"
os: "ubuntu-latest"
target: "x86_64-unknown-linux-gnu"
- name: "stable mac"
os: "macos-latest"
target: "x86_64-apple-darwin"
- name: "stable windows"
os: "windows-latest"
target: "x86_64-pc-windows-msvc"
fail-fast: false
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
steps:
- uses: actions/checkout@v4
- name: install rust
shell: bash
run: |
set -e
rustup toolchain install ${{ env.CI_RUST_VERSION }} --no-self-update --profile=minimal --component clippy
rustup override set ${{ env.CI_RUST_VERSION }}
rustup target add ${{ matrix.target }}
cargo -V
- uses: Swatinem/rust-cache@v2
- name: clippy
shell: bash
run: cargo clippy --all-features --target ${{ matrix.target }}
- name: test
shell: bash
if: matrix.name != 'stable wasm'
run: cargo test --all-features --target ${{ matrix.target }}
msrv:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: install rust
run: |
set -e
rustup toolchain install ${{ env.MSRV }} --no-self-update --profile=minimal
rustup override set ${{ env.MSRV }}
cargo -V
- name: check msrv
run: |
set -e
cargo check
cargo check --no-default-features
cargo-fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust toolchain
run: |
rustup component add rustfmt
- name: Rustfmt
run: |
cargo fmt -- --check
cargo-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
with:
log-level: warn
command: check
arguments: --all-features