Skip to content

fix: report syntax errors as errors, not warnings #2204

fix: report syntax errors as errors, not warnings

fix: report syntax errors as errors, not warnings #2204

Workflow file for this run

name: ci
on:
push:
branches: ["main"]
pull_request:
branches: ["main", "docs"]
jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
check-latest: true
- name: Install dependencies
# we need to change the python version used by uv here otherwise it wil use the version from .python-version.
# we also need to use the setup-python action for some reason even though uv can manage python versions because
# the rust compilation will otherwise fail
run: |
./pw uv python pin ${{ matrix.python-version }}
./pw uv sync --all-groups
- name: Check ruff
run: |
./pw uv run ruff check
./pw uv run ruff format --check
- name: Test with cargo
run: |
./pw uv run cargo test --no-default-features
- name: Test with pytest and report coverage
run: |
./pw uv run coverage run --branch --source=python -m pytest
./pw uv run coverage report
- name: Check types with basedpyright
run: |
./pw uv run basedpyright
- name: Check tach
run: ./pw uv run tach check
- name: Check Rust linting
run: ./pw uv run cargo clippy
- name: Check Rust formatting
run: ./pw uv run cargo fmt --all --check
- name: Check Rust
run: ./pw uv run cargo check
- name: Check docs
run: make docs-build
# for some insane reason it's impossible to configure github actions to require that all checks pass before merging.
# you have to create a rule eith every single job in your ci, and remember to manually update that rule when they change.
# so instead we need this job at the end that checks the status of all the previous jobs so we don't need to constantly
# worry about keeping the rule up to date.
all-checks:
runs-on: ubuntu-latest
needs: build
if: always()
steps:
- name: Check previous job results
run: |
if [ "${{ needs.build.result }}" != "success" ]; then
echo "previous jobs failed"
exit 1
fi