fix(db): Postgres executescript skips comment-only chunks + CLI sched… #57
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: tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| # Cancel in-flight runs for the same branch when new commits arrive. | |
| concurrency: | |
| group: tests-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| mypy: | |
| name: mypy (type check) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install runtime + mypy | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt mypy | |
| - name: Type-check | |
| run: mypy --config-file mypy.ini | |
| pytest: | |
| name: pytest (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: Install runtime dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Install test dependencies | |
| run: pip install pytest pytest-cov hypothesis | |
| - name: Run tests with coverage | |
| run: | | |
| pytest \ | |
| tests/test_gate.py \ | |
| tests/test_vault.py \ | |
| tests/test_watch.py \ | |
| tests/test_proxy.py \ | |
| tests/test_webhooks.py \ | |
| tests/test_idempotency.py \ | |
| tests/test_tracing.py \ | |
| tests/test_middleware.py \ | |
| tests/test_logging.py \ | |
| tests/test_metrics.py \ | |
| tests/test_validation.py \ | |
| tests/test_openapi.py \ | |
| tests/test_status.py \ | |
| tests/test_db.py \ | |
| tests/test_rate_limit_headers.py \ | |
| tests/test_audit_export.py \ | |
| tests/test_migrate.py \ | |
| tests/test_webhook_delivery.py \ | |
| tests/test_admin.py \ | |
| tests/test_health.py \ | |
| tests/test_cli_commands.py \ | |
| tests/test_admin_html.py \ | |
| tests/test_scopes.py \ | |
| tests/test_compliance.py \ | |
| tests/test_compliance_html.py \ | |
| tests/test_dockerfile.py \ | |
| tests/test_compliance_scheduler.py \ | |
| tests/test_vault_properties.py \ | |
| tests/test_watch_properties.py \ | |
| --cov=haldir_gate \ | |
| --cov=haldir_vault \ | |
| --cov=haldir_watch \ | |
| --cov-report=xml \ | |
| --cov-report=term-missing \ | |
| -v | |
| - name: Upload coverage to Codecov | |
| # Only upload once per CI run (from the lowest Python in the matrix) | |
| # to avoid hammering codecov with N parallel uploads of the same data. | |
| if: matrix.python-version == '3.10' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: false | |
| flags: python | |
| name: haldir-${{ matrix.python-version }} | |
| # CODECOV_TOKEN is optional for public repos but recommended. | |
| # Set in repo Settings → Secrets → Actions if you have one. | |
| token: ${{ secrets.CODECOV_TOKEN }} |