Skip to content

🎨 Add ruff & pyright #783

🎨 Add ruff & pyright

🎨 Add ruff & pyright #783

Workflow file for this run

name: lint
on:
pull_request:
push:
branches: [main]
merge_group:
jobs:
pre-commit:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
env:
NIX_PATH: nixpkgs=https://github.com/NixOS/nixpkgs/archive/43862987c3cf2554a542c6dd81f5f37435eb1423.tar.gz # keep in sync with shell.nix
steps:
- uses: actions/checkout@v3
- name: install nix
uses: nixbuild/nix-quick-install-action@v22
- name: setup direnv
uses: JRMurr/[email protected]
with:
install-nix: "false" # we already install nix
cache-store: "false" # turned out to be faster without the cache
- name: Setup backend pypackages cache
uses: actions/cache@v3
with:
path: |
backend/__pypackages__/
key: ${{ runner.os }}-pypackages-${{ hashFiles('backend/pdm.lock') }}
- name: Setup worker pypackages cache
uses: actions/cache@v3
with:
path: |
worker/__pypackages__/
key: ${{ runner.os }}-pypackages-${{ hashFiles('worker/pdm.lock') }}
- name: install dependencies
run: ./packaging/install_dependencies.sh
- name: cache pre-commit env
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: ${{ matrix.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: run pre-commit
run: pre-commit run --show-diff-on-failure --color=always --all-files