Skip to content

chore: CI Improvements #28

chore: CI Improvements

chore: CI Improvements #28

Workflow file for this run

name: Lint Rust Source
permissions:
contents: read
pull-requests: write
checks: write
on:
pull_request:
env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
rustfmt:
name: Check Rust Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Run rustfmt
run: cargo fmt --all --check
lint:
name: Run Clippy
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Cache OpenCASCADE
uses: actions/cache@v4
with:
path: |
crates/opencascade-sys/occt_build
crates/opencascade-sys/occt_source
key: opencascade-${{ runner.os }}-${{ hashFiles('**/occt_commit_hash.lock') }}
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: cargo-${{ runner.os }}-stable-${{ hashFiles('**/Cargo.lock') }}
- name: Run clippy
uses: giraffate/clippy-action@v1
with:
reporter: "github-pr-review"
clippy_flags: "--workspace"
github_token: ${{ secrets.GITHUB_TOKEN }}
typos-cli:
name: Check for typos
runs-on: ubuntu-latest
steps:
- name: Fetch Repository
uses: actions/checkout@v4
- name: Install Typos
uses: taiki-e/install-action@v2
with:
tool: typos-cli
- name: run typos
run: typos