This repository was archived by the owner on Jul 12, 2026. It is now read-only.
Release/4.1.0 #351
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: Check Rust | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: check-rust-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled, unlabeled] | |
| workflow_dispatch: | |
| inputs: | |
| verbose: | |
| description: "Output more information when triggered manually" | |
| required: false | |
| default: "" | |
| env: | |
| CARGO_TERM_COLOR: always | |
| VERBOSE: ${{ github.event.inputs.verbose }} | |
| jobs: | |
| cargo-fmt: | |
| name: cargo fmt | |
| runs-on: ubuntu-latest | |
| if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-check-rust') }} | |
| steps: | |
| - name: Check-out repository | |
| uses: actions/checkout@v6 | |
| - name: Install Rust Nightly | |
| run: | | |
| rustup install nightly | |
| rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt | |
| - name: Utilize Shared Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: cargo fmt | |
| run: cargo +nightly fmt --check --all | |
| cargo-clippy: | |
| name: cargo clippy | |
| runs-on: ubuntu-latest | |
| if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-check-rust') }} | |
| steps: | |
| - name: Check-out repository | |
| uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update && | |
| sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler | |
| - name: Utilize Shared Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: cargo clippy (default features) | |
| run: cargo clippy --workspace --all-targets -- -D warnings | |
| cargo-clippy-all-features: | |
| name: cargo clippy --all-features | |
| runs-on: ubuntu-latest | |
| if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-check-rust') }} | |
| steps: | |
| - name: Check-out repository | |
| uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update && | |
| sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler | |
| - name: Utilize Shared Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: cargo clippy --all-features | |
| run: cargo clippy --workspace --all-targets --all-features -- -D warnings | |
| cargo-test: | |
| name: cargo test | |
| runs-on: ubuntu-latest | |
| if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-check-rust') }} | |
| steps: | |
| - name: Check-out repository | |
| uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update && | |
| sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler | |
| - name: Utilize Shared Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: cargo test --all-features | |
| run: cargo test --workspace --all-features --lib --tests | |
| cargo-package-check: | |
| name: cargo package (dry-run) | |
| runs-on: ubuntu-latest | |
| if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-check-rust') }} | |
| steps: | |
| - name: Check-out repository | |
| uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update && | |
| sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler pkg-config | |
| - name: Utilize Shared Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: cargo package (dry-run) | |
| run: cargo package --no-verify |