refactor parsing benchmarks to measure actual parsing (#258) #618
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: lint | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
workflow_call: | |
concurrency: | |
group: lint-${{ github.head_ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
env: | |
CARGO_TERM_COLOR: always | |
FORCE_COLOR: "1" | |
PYTHONUNBUFFERED: "1" | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v5 | |
with: | |
persist-credentials: false | |
- name: Install uv | |
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4 | |
with: | |
activate-environment: true | |
enable-cache: true | |
# HACK: there's a bug in either `astral-sh/setup-uv` or pre-commit-uv or both | |
# because uv gets installed to `/opt/hostedtoolcache/uv/<version>/x86_64/uv` | |
# and pre-commit-uv apparently only looks for it at `~/.local/bin/uv` | |
- run: | | |
mkdir -p ~/.local/bin | |
ln -sf $(which uv) ~/.local/bin/uv | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pre-commit/ | |
key: pre-commit-1|${{ hashFiles('.pre-commit-config.yaml') }} | |
- name: Run pre-commit | |
run: | | |
SKIP=no-commit-to-branch \ | |
uv run --no-project --with "nox[uv]" nox --session lint | |
rustfmt: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v5 | |
with: | |
persist-credentials: false | |
- uses: actions-rust-lang/setup-rust-toolchain@2fcdc490d667999e01ddbbf0f2823181beef6b39 | |
with: | |
toolchain: nightly | |
components: rustfmt | |
- name: Run rustfmt | |
run: cargo +nightly fmt --all -- --check | |
clippy: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v5 | |
with: | |
persist-credentials: false | |
- uses: actions-rust-lang/setup-rust-toolchain@2fcdc490d667999e01ddbbf0f2823181beef6b39 | |
with: | |
components: clippy | |
- name: Run clippy | |
run: cargo clippy --all-targets --all-features --benches -- -D warnings | |
cargo-check: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v5 | |
with: | |
persist-credentials: false | |
- uses: actions-rust-lang/setup-rust-toolchain@2fcdc490d667999e01ddbbf0f2823181beef6b39 | |
- name: Run cargo check | |
run: cargo check --all-targets --all-features |