[rust] Setup PR checks (#6707)
This commit is contained in:
41
.github/workflows/rust-lint.yml
vendored
Normal file
41
.github/workflows/rust-lint.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: "Lint (rust)"
|
||||
|
||||
on:
|
||||
# Run on every pull request (open or push to it) that changes rust/
|
||||
pull_request:
|
||||
paths:
|
||||
- "rust/**"
|
||||
- ".github/workflows/rust-lint.yml"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
# Cancel in-progress lint runs when a new commit is pushed.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: rust
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- run: cargo fmt --check
|
||||
|
||||
- run: cargo clippy
|
||||
|
||||
- run: cargo build
|
||||
Reference in New Issue
Block a user