refactor(tests): replace dataclass lambdas with typed factory functions #214
Workflow file for this run
This file contains hidden or 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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - "**" | |
| permissions: | |
| contents: read | |
| jobs: | |
| ruff: | |
| name: Ruff | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v7 | |
| - name: Run Ruff | |
| # ruff-action has v4.1.0 / v4.0.0 tags, not a floating v4 major. | |
| uses: astral-sh/ruff-action@v4.1.0 | |
| with: | |
| version: "0.16.3" | |
| args: check --output-format=github | |
| - name: Check Ruff format | |
| uses: astral-sh/ruff-action@v4.1.0 | |
| with: | |
| version: "0.16.3" | |
| args: format --check | |
| hadolint: | |
| name: Hadolint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v7 | |
| - name: Lint Dockerfile | |
| run: docker run --rm -i hadolint/hadolint < Dockerfile | |
| spectral: | |
| name: Spectral | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v7 | |
| - name: Lint OpenAPI | |
| run: make spectral | |
| lint: | |
| name: Lint | |
| if: ${{ !cancelled() }} | |
| needs: [ruff, hadolint, spectral] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Require Ruff, Hadolint, and Spectral | |
| run: | | |
| test "${{ needs.ruff.result }}" = "success" | |
| test "${{ needs.hadolint.result }}" = "success" | |
| test "${{ needs.spectral.result }}" = "success" | |
| unit-tests: | |
| name: Run unit tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v7 | |
| - name: Get Python version from Dockerfile | |
| id: get-version | |
| run: | | |
| # Extract version like "3.14" from "FROM python:3.14-slim..." | |
| VERSION=$(grep -m 1 "^FROM python:" Dockerfile | sed -E 's/^FROM python:([0-9]+\.[0-9]+).*/\1/') | |
| if [ -z "$VERSION" ]; then | |
| echo "Error: Could not extract Python version from Dockerfile" | |
| exit 1 | |
| fi | |
| echo "Extracted version: $VERSION" | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Set up Python | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ steps.get-version.outputs.version }} | |
| cache: "pip" | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install -r requirements-dev.txt | |
| - name: Execute unit test suite | |
| run: python -m unittest discover -s tests -p "test_*.py" -v | |
| - name: Typecheck | |
| run: make typecheck | |
| - name: Verify OpenAPI snapshot | |
| run: make openapi-verify | |
| smoke-test: | |
| name: Run docker smoke test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v7 | |
| - name: Execute smoke test | |
| run: make smoke |