|
| 1 | +name: Python check |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + paths-ignore: |
| 7 | + - "**.md" |
| 8 | + - ".azdo/**" |
| 9 | + - ".devcontainer/**" |
| 10 | + - ".github/**" |
| 11 | + pull_request: |
| 12 | + branches: [ main ] |
| 13 | + paths-ignore: |
| 14 | + - "**.md" |
| 15 | + - ".azdo/**" |
| 16 | + - ".devcontainer/**" |
| 17 | + - ".github/**" |
| 18 | + workflow_call: |
| 19 | + |
| 20 | +jobs: |
| 21 | + test_package: |
| 22 | + name: Test ${{ matrix.os }} Python ${{ matrix.python_version }} |
| 23 | + runs-on: ${{ matrix.os }} |
| 24 | + strategy: |
| 25 | + fail-fast: false |
| 26 | + matrix: |
| 27 | + os: ["ubuntu-20.04", "windows-latest"] |
| 28 | + python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"] |
| 29 | + env: |
| 30 | + UV_SYSTEM_PYTHON: 1 |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v4 |
| 33 | + - name: Setup python |
| 34 | + uses: actions/setup-python@v5 |
| 35 | + with: |
| 36 | + python-version: ${{ matrix.python_version }} |
| 37 | + architecture: x64 |
| 38 | + - name: Install uv |
| 39 | + uses: astral-sh/setup-uv@v5 |
| 40 | + with: |
| 41 | + enable-cache: true |
| 42 | + version: "0.4.20" |
| 43 | + cache-dependency-glob: "requirements**.txt" |
| 44 | + - name: Setup node |
| 45 | + uses: actions/setup-node@v4 |
| 46 | + with: |
| 47 | + node-version: 18 |
| 48 | + - name: Build frontend |
| 49 | + run: | |
| 50 | + cd ./app/frontend |
| 51 | + npm install |
| 52 | + npm run build |
| 53 | + - name: Install dependencies |
| 54 | + run: | |
| 55 | + uv pip install -r requirements-dev.txt |
| 56 | + - name: Lint with ruff |
| 57 | + run: ruff check . |
| 58 | + - name: Check types with mypy |
| 59 | + run: | |
| 60 | + cd scripts/ |
| 61 | + python3 -m mypy . --config-file=../pyproject.toml |
| 62 | + cd ../app/backend/ |
| 63 | + python3 -m mypy . --config-file=../../pyproject.toml |
| 64 | + - name: Check formatting with black |
| 65 | + run: black . --check --verbose |
| 66 | + - name: Run Python tests |
| 67 | + if: runner.os != 'Windows' |
| 68 | + run: python3 -m pytest -s -vv --cov --cov-fail-under=86 |
| 69 | + - name: Run E2E tests with Playwright |
| 70 | + id: e2e |
| 71 | + if: runner.os != 'Windows' |
| 72 | + run: | |
| 73 | + playwright install chromium --with-deps |
| 74 | + python3 -m pytest tests/e2e.py --tracing=retain-on-failure |
| 75 | + - name: Upload test artifacts |
| 76 | + if: ${{ failure() && steps.e2e.conclusion == 'failure' }} |
| 77 | + uses: actions/upload-artifact@v4 |
| 78 | + with: |
| 79 | + name: playwright-traces${{ matrix.python_version }} |
| 80 | + path: test-results |
0 commit comments