fix clippy errors (#31) #101
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: | |
branches: [ "main" ] | |
tags: [ "v*" ] | |
pull_request: | |
branches: [ "main" ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
RUST_BACKTRACE: 1 | |
NIGHTLY_VERSION: nightly-2023-03-19 | |
jobs: | |
########################## | |
# Linting and formatting # | |
########################## | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: stable | |
components: clippy | |
- run: cargo clippy --workspace -- -D warnings | |
rustfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
toolchain: $NIGHTLY_VERSION | |
components: rustfmt | |
- run: cargo +$NIGHTLY_VERSION fmt --all -- --check | |
########### | |
# Testing # | |
########### | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: stable | |
- run: cargo test --workspace | |
env: | |
# fix rustdoc issue with macros | |
CARGO_TARGET_TMPDIR: "" | |
################# | |
# Documentation # | |
################# | |
rustdoc: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
toolchain: $NIGHTLY_VERSION | |
- run: cargo +$NIGHTLY_VERSION doc --workspace --no-deps | |
env: | |
RUSTDOCFLAGS: --cfg docsrs |