build: (14) Remove unused Rust dependencies (#15) #86
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: Lint Rust Code | |
"on": | |
# Since the repository is public, there are no concerns regarding CI usage. | |
push: | |
# Concurrency serves to prevent simultaneous execution of multiple identical | |
# workflows in the same branch. | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref }}" | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: Lint Rust Code | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
target: "x86_64-unknown-linux-gnu" | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: read | |
packages: read | |
statuses: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Extract Rust Channel | |
shell: bash | |
id: toolchain | |
run: ./scripts/extract_rust_channel.sh | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
components: "clippy, rustfmt" | |
toolchain: ${{ steps.toolchain.outputs.version }} | |
targets: ${{ matrix.target }} | |
- name: Cache dependencies | |
id: cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
prefix-key: rust-${{ matrix.os }}-${{ matrix.target }}- | |
shared-key: linters | |
cache-targets: true | |
cache-all-crates: true | |
# The 'generate-caches.yaml' workflow is responsible for caching the | |
# dependencies. | |
save-if: false | |
- name: Run Rustfmt | |
run: cargo fmt -- --check | |
- name: Run Clippy | |
shell: bash | |
run: | | |
cargo clippy \ | |
--all-features \ | |
--all-targets \ | |
--target ${{ matrix.target }} | |
... |