Use core and alloc over std #40
This file contains hidden or 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: Rust Lint | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: { } | |
| jobs: | |
| fmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@master | |
| id: toolchain | |
| with: | |
| toolchain: nightly | |
| components: rustfmt | |
| - name: Fmt Check | |
| run: cargo +${{steps.toolchain.outputs.name}} fmt --check | |
| clippy: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| rust-version: [ stable ] | |
| info: | |
| - os: macos-latest | |
| - os: ubuntu-latest | |
| - os: windows-latest | |
| runs-on: ${{ matrix.info.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@master | |
| id: toolchain | |
| with: | |
| toolchain: ${{ matrix.rust-version }} | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: clippy | |
| - name: Clippy | |
| run: cargo +${{steps.toolchain.outputs.name}} clippy --all-targets --all-features --verbose --workspace -- -D warnings | |
| - name: Clippy Release | |
| run: cargo +${{steps.toolchain.outputs.name}} clippy --all-targets --all-features --verbose --workspace --release -- -D warnings | |
| docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@master | |
| id: toolchain | |
| with: | |
| toolchain: stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: docs | |
| - name: Docs | |
| env: | |
| RUSTDOCFLAGS: -Dwarnings | |
| run: cargo +${{steps.toolchain.outputs.name}} doc --all-features --verbose --workspace | |
| - name: Docs Release | |
| env: | |
| RUSTDOCFLAGS: -Dwarnings | |
| run: cargo +${{steps.toolchain.outputs.name}} doc --all-features --verbose --workspace --release | |
| cargo-msrv: | |
| strategy: | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@master | |
| id: toolchain | |
| with: | |
| toolchain: stable | |
| - uses: cargo-prebuilt/cargo-prebuilt-action@v4 | |
| with: | |
| pkgs: cargo-msrv | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: msrv | |
| - name: MSRV | |
| run: cargo msrv verify --output-format json -- cargo check --verbose | |
| cargo-hack: | |
| strategy: | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@master | |
| id: toolchain | |
| with: | |
| toolchain: stable | |
| - uses: cargo-prebuilt/cargo-prebuilt-action@v4 | |
| with: | |
| pkgs: cargo-hack | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: hack | |
| - name: Test all features | |
| run: cargo hack check --each-feature --no-dev-deps --verbose --workspace | |
| - name: Test all feature powersets | |
| run: cargo hack check --feature-powerset --no-dev-deps --verbose --workspace | |
| # https://github.com/EmbarkStudios/cargo-deny/issues/324 | |
| cargo-deny: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: aarch64-apple-darwin | |
| uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| command: check | |
| log-level: error | |
| arguments: --all-features --target aarch64-apple-darwin | |
| - name: aarch64-unknown-linux-gnu | |
| uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| command: check | |
| log-level: error | |
| arguments: --all-features --target aarch64-unknown-linux-gnu | |
| - name: aarch64-unknown-linux-musl | |
| uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| command: check | |
| log-level: error | |
| arguments: --all-features --target aarch64-unknown-linux-musl | |
| - name: i686-pc-windows-gnu | |
| uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| command: check | |
| log-level: error | |
| arguments: --all-features --target i686-pc-windows-gnu | |
| - name: i686-pc-windows-msvc | |
| uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| command: check | |
| log-level: error | |
| arguments: --all-features --target i686-pc-windows-msvc | |
| - name: i686-unknown-linux-gnu | |
| uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| command: check | |
| log-level: error | |
| arguments: --all-features --target i686-unknown-linux-gnu | |
| - name: riscv64gc-unknown-linux-gnu | |
| uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| command: check | |
| log-level: error | |
| arguments: --all-features --target riscv64gc-unknown-linux-gnu | |
| - name: riscv64gc-unknown-linux-musl | |
| uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| command: check | |
| log-level: error | |
| arguments: --all-features --target riscv64gc-unknown-linux-musl | |
| - name: wasm32-unknown-unknown | |
| uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| command: check | |
| log-level: error | |
| arguments: --all-features --target wasm32-unknown-unknown | |
| - name: x86_64-apple-darwin | |
| uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| command: check | |
| log-level: error | |
| arguments: --all-features --target x86_64-apple-darwin | |
| - name: x86_64-pc-windows-gnu | |
| uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| command: check | |
| log-level: error | |
| arguments: --all-features --target x86_64-pc-windows-gnu | |
| - name: x86_64-pc-windows-msvc | |
| uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| command: check | |
| log-level: error | |
| arguments: --all-features --target x86_64-pc-windows-msvc | |
| - name: x86_64-unknown-linux-gnu | |
| uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| command: check | |
| log-level: error | |
| arguments: --all-features --target x86_64-unknown-linux-gnu | |
| - name: x86_64-unknown-linux-musl | |
| uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| command: check | |
| log-level: error | |
| arguments: --all-features --target x86_64-unknown-linux-musl | |
| - name: x86_64-unknown-redox | |
| uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| command: check | |
| log-level: error | |
| arguments: --all-features --target x86_64-unknown-redox |