feat(python): Adding support for pre-commit linter and formatter based on ruff #325
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: Python Checks | |
on: pull_request | |
jobs: | |
python-checks: | |
runs-on: ubuntu-latest | |
env: | |
PATH: ${{ github.workspace }}/go/bin:${{ github.workspace }}/.cargo/bin:${{ github.workspace }}/.local/share/pnpm:${{ github.workspace }}/.local/bin:/usr/local/bin:/usr/bin:/bin | |
strategy: | |
matrix: | |
python-version: | |
- "3.12" | |
defaults: | |
run: | |
working-directory: py | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pre-requisites | |
run: bin/setup -a ci | |
- name: Install uv and setup Python version | |
uses: astral-sh/setup-uv@v5 | |
with: | |
enable-cache: true | |
python-version: ${{ matrix.python-version }} | |
# TODO: uncomment linter checks once codestyle is migrated | |
# - name: Format check | |
# run: uv run ruff format --check . | |
# | |
# - name: Lint with ruff | |
# run: uv run ruff check . | |
- name: Run tests | |
run: ./bin/run_tests | |
- name: Build documentation | |
run: uv run mkdocs build --strict | |
- name: Build distributions | |
run: ./bin/build_dists |