mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-12-23 08:47:53 +00:00
Some checks failed
bench / benchmarks (push) Has been cancelled
build / binary (map[runner:macos-13 target:x86_64]) (push) Has been cancelled
build / binary (map[runner:macos-14 target:aarch64]) (push) Has been cancelled
build / binary (map[runner:windows-latest target:x86_64]) (push) Has been cancelled
build / windows (map[runner:windows-latest target:x64]) (push) Has been cancelled
build / macos (map[runner:macos-13 target:x86_64]) (push) Has been cancelled
build / sdist (push) Has been cancelled
zizmor 🌈 / zizmor (push) Has been cancelled
build / macos (map[runner:macos-14 target:aarch64]) (push) Has been cancelled
build / attest (push) Has been cancelled
lint / pre-commit (push) Waiting to run
lint / rustfmt (push) Blocked by required conditions
lint / clippy (push) Blocked by required conditions
lint / cargo-check (push) Blocked by required conditions
test / tests (push) Blocked by required conditions
lint / rust-changes (push) Waiting to run
test / generate-matrix (push) Waiting to run
test / Python , Django () (push) Blocked by required conditions
build / binary (map[runner:ubuntu-22.04 target:aarch64]) (push) Failing after 3s
build / binary (map[runner:ubuntu-22.04 target:x86_64]) (push) Failing after 1s
build / linux (map[runner:ubuntu-22.04 target:aarch64]) (push) Failing after 2s
build / linux (map[runner:ubuntu-22.04 target:x86_64]) (push) Failing after 4s
build / musllinux (map[runner:ubuntu-22.04 target:aarch64]) (push) Failing after 2s
build / musllinux (map[runner:ubuntu-22.04 target:x86_64]) (push) Failing after 3s
176 lines
5 KiB
YAML
176 lines
5 KiB
YAML
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@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41
|
|
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
|
|
|
|
rust-changes:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
rust: ${{ steps.filter.outputs.rust }}
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
rust:
|
|
- '.github/workflows/lint.yml'
|
|
- 'crates/**'
|
|
- 'Cargo.lock'
|
|
- 'Cargo.toml'
|
|
|
|
rustfmt:
|
|
runs-on: ubuntu-24.04
|
|
needs: rust-changes
|
|
if: needs.rust-changes.outputs.rust == 'true'
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Cache rustup toolchain
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.rustup
|
|
key: ${{ runner.os }}-${{ runner.arch }}-rustup-nightly-${{ hashFiles('.github/workflows/lint.yml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-${{ runner.arch }}-rustup-nightly-
|
|
|
|
- name: Cache Cargo dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/git
|
|
~/.cargo/registry
|
|
key: ${{ runner.os }}-${{ runner.arch }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-${{ runner.arch }}-cargo-registry-
|
|
${{ runner.os }}-cargo-registry-
|
|
|
|
- uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c
|
|
with:
|
|
toolchain: nightly
|
|
components: rustfmt
|
|
|
|
- name: Run rustfmt
|
|
run: cargo +nightly fmt --all -- --check
|
|
|
|
clippy:
|
|
runs-on: ubuntu-24.04
|
|
needs: rust-changes
|
|
if: needs.rust-changes.outputs.rust == 'true'
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Cache rustup toolchain
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.rustup
|
|
key: ${{ runner.os }}-${{ runner.arch }}-rustup-${{ hashFiles('rust-toolchain.toml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-${{ runner.arch }}-rustup-
|
|
|
|
- name: Cache Cargo dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/git
|
|
~/.cargo/registry
|
|
key: ${{ runner.os }}-${{ runner.arch }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-${{ runner.arch }}-cargo-registry-
|
|
${{ runner.os }}-cargo-registry-
|
|
|
|
- uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c
|
|
with:
|
|
components: clippy
|
|
|
|
- name: Run clippy
|
|
run: cargo clippy --all-targets --all-features --benches -- -D warnings
|
|
|
|
cargo-check:
|
|
runs-on: ubuntu-24.04
|
|
needs: rust-changes
|
|
if: needs.rust-changes.outputs.rust == 'true'
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Cache rustup toolchain
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.rustup
|
|
key: ${{ runner.os }}-${{ runner.arch }}-rustup-${{ hashFiles('rust-toolchain.toml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-${{ runner.arch }}-rustup-
|
|
|
|
- name: Cache Cargo registry
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/git
|
|
~/.cargo/registry
|
|
key: ${{ runner.os }}-${{ runner.arch }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-${{ runner.arch }}-cargo-registry-
|
|
${{ runner.os }}-cargo-registry-
|
|
|
|
- uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c
|
|
|
|
- name: Run cargo check
|
|
run: cargo check --all-targets --all-features
|