chore: fix some lint issues #583
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
LATEST_STABLE_RUST_VERSION: "TBD" | |
jobs: | |
format: | |
name: Formatting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
- name: Get latest stable Rust version | |
run: | | |
echo "LATEST_STABLE_RUST_VERSION=$(gh api /repos/rust-lang/rust/releases --jq ".[0].tag_name")" >> "$GITHUB_ENV" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache Toolchain | |
uses: actions/cache@v4 | |
with: | |
path: ~/.rustup | |
key: toolchain-x86-64-${{ env.LATEST_STABLE_RUST_VERSION }} | |
- name: Install `stable` Toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
components: rustfmt,clippy | |
- name: Rustfmt Check | |
uses: actions-rust-lang/rustfmt@v1 | |
lint: | |
name: Lint (Stable) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
- name: Get latest stable Rust version | |
run: | | |
echo "LATEST_STABLE_RUST_VERSION=$(gh api /repos/rust-lang/rust/releases --jq ".[0].tag_name")" >> "$GITHUB_ENV" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache Toolchain | |
uses: actions/cache@v4 | |
with: | |
path: ~/.rustup | |
key: toolchain-x86-64-${{ env.LATEST_STABLE_RUST_VERSION }} | |
- name: Install `stable` Toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
components: rustfmt,clippy | |
- uses: LoliGothick/clippy-check@master | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
options: --features=serde,rkyv,test_utils --no-deps | |
name: Clippy (stable) | |
- name: Check Rustdoc Links | |
run: RUSTDOCFLAGS="--deny broken_intra_doc_links" cargo doc --verbose --workspace --no-deps --document-private-items | |
lint-unstable: | |
name: Lint (Nightly) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
- name: Get date | |
run: | | |
echo "TODAY_DATE=$(date -Idate)" >> "$GITHUB_ENV" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache Toolchain | |
uses: actions/cache@v4 | |
with: | |
path: ~/.rustup | |
key: toolchain-x86-64-nightly-${{ env.TODAY_DATE }} | |
- name: Install `nightly` Toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: nightly | |
components: rustfmt,clippy | |
- uses: LoliGothick/clippy-check@master | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
options: --all-features --no-deps | |
name: Clippy (nightly) | |
- name: Check Rustdoc Links | |
run: RUSTDOCFLAGS="--deny broken_intra_doc_links" cargo doc --verbose --workspace --no-deps --document-private-items | |
check: | |
name: Cargo Check (Stable) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
- name: Get latest stable Rust version | |
run: | | |
echo "LATEST_STABLE_RUST_VERSION=$(gh api /repos/rust-lang/rust/releases --jq ".[0].tag_name")" >> "$GITHUB_ENV" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache Toolchain | |
uses: actions/cache@v4 | |
with: | |
path: ~/.rustup | |
key: toolchain-x86-64-${{ env.LATEST_STABLE_RUST_VERSION }} | |
- name: Install `stable` Toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
components: rustfmt,clippy | |
- name: Install cargo-hack | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-hack | |
version: "^0.6" | |
- name: Cargo check all targets and features | |
run: cargo hack check --workspace --each-feature --all-targets --exclude-features global_allocate,simd | |
check-unstable: | |
name: Cargo Check (Nightly) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
- name: Get date | |
run: | | |
echo "TODAY_DATE=$(date -Idate)" >> "$GITHUB_ENV" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache Toolchain | |
uses: actions/cache@v4 | |
with: | |
path: ~/.rustup | |
key: toolchain-x86-64-nightly-${{ env.TODAY_DATE }} | |
- name: Install `nightly` Toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: nightly | |
components: rustfmt,clippy | |
- name: Install cargo-hack | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-hack | |
version: "^0.6" | |
- name: Cargo check all targets and features | |
run: cargo hack check --workspace --each-feature --all-targets | |
test-basic: | |
name: Run Tests (Stable, no crate features enabled that require unstable Rust) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
- name: Get latest stable Rust version | |
run: | | |
echo "LATEST_STABLE_RUST_VERSION=$(gh api /repos/rust-lang/rust/releases --jq ".[0].tag_name")" >> "$GITHUB_ENV" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache Toolchain | |
uses: actions/cache@v4 | |
with: | |
path: ~/.rustup | |
key: toolchain-x86-64-${{ env.LATEST_STABLE_RUST_VERSION }} | |
- name: Install `stable` Toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
components: rustfmt,clippy | |
- name: Cargo test | |
run: | | |
cargo run --example build-float-doctest-tree --features="rkyv" | |
cargo run --example build-immutable-doctest-tree --features="rkyv" | |
cargo test --workspace --features=serde,rkyv,test_utils | |
test-all-features: | |
name: Run Tests (Nightly, all features enabled) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
- name: Get date | |
run: | | |
echo "TODAY_DATE=$(date -Idate)" >> "$GITHUB_ENV" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache Toolchain | |
uses: actions/cache@v4 | |
with: | |
path: ~/.rustup | |
key: toolchain-x86-64-nightly-${{ env.TODAY_DATE }} | |
- name: Install `nightly` Toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: nightly | |
components: rustfmt,clippy | |
- name: Cargo test | |
env: | |
RUSTFLAGS: '-C target-cpu=native' | |
run: | | |
cargo run --example build-float-doctest-tree --features="rkyv" | |
cargo run --example build-immutable-doctest-tree --features="rkyv" | |
cargo test --workspace --all-features --release |