ci: github action caching improved #984
Workflow file for this run
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 Pull Request | |
on: | |
pull_request: | |
jobs: | |
lint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
enable-cache: true | |
cache-dependency-glob: pyproject.toml | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Cache Cargo registry | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache Cargo build artifacts | |
uses: actions/cache@v4 | |
with: | |
path: target | |
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install dependencies | |
run: | | |
uv sync --extra dev | |
- name: Activate venv for Pyright | |
run: echo "$PWD/.venv/bin" >> $GITHUB_PATH | |
- name: Lint with ruff | |
run: uv run ruff check --output-format=github . | |
- name: Lint imports with ruff | |
run: uv run ruff check --select I --output-format=github . | |
- name: Check typing with pyright | |
uses: jakebailey/pyright-action@v2 | |
with: | |
version: 1.1.311 | |
- name: Lint with clippy | |
run: cargo clippy --all-targets --all-features -- -D warnings |