Merge pull request #87 from forecast-bio/feature/M2KE-2Jps-phases-3-5… #123
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: Integration tests | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| # Nightly at 06:00 UTC | |
| - cron: "0 6 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: integration-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| integration: | |
| name: Live integration tests | |
| runs-on: ubuntu-latest | |
| environment: integration | |
| # Integration failures show as red but don't block merges (the check | |
| # is not listed as required in branch protection rules). | |
| services: | |
| postgres: | |
| image: public.ecr.aws/docker/library/postgres:16 | |
| ports: | |
| - 5432:5432 | |
| env: | |
| POSTGRES_USER: atdata | |
| POSTGRES_PASSWORD: atdata_test | |
| POSTGRES_DB: atdata_integration | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| redis: | |
| image: public.ecr.aws/docker/library/redis:7 | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: Install the project | |
| run: uv sync --locked --all-extras --dev | |
| # MinIO doesn't support GitHub Actions service containers well | |
| # (needs explicit `server /data` command). Run it directly. | |
| - name: Start MinIO | |
| run: | | |
| docker run -d --name minio \ | |
| -p 9000:9000 \ | |
| -e MINIO_ROOT_USER=minioadmin \ | |
| -e MINIO_ROOT_PASSWORD=minioadmin \ | |
| minio/minio:latest server /data | |
| for i in $(seq 1 30); do | |
| curl -sf http://localhost:9000/minio/health/live && break | |
| sleep 1 | |
| done | |
| - name: Run integration tests | |
| env: | |
| # ATProto — stored in GitHub environment secrets | |
| ATPROTO_TEST_HANDLE: ${{ secrets.ATPROTO_TEST_HANDLE }} | |
| ATPROTO_TEST_PASSWORD: ${{ secrets.ATPROTO_TEST_PASSWORD }} | |
| # MinIO | |
| MINIO_ENDPOINT: http://localhost:9000 | |
| MINIO_ACCESS_KEY: minioadmin | |
| MINIO_SECRET_KEY: minioadmin | |
| # PostgreSQL | |
| POSTGRES_DSN: postgresql://atdata:atdata_test@localhost:5432/atdata_integration | |
| # Redis | |
| REDIS_URL: redis://localhost:6379/0 | |
| # Override addopts to drop the default '-m not integration' filter | |
| # and disable coverage (integration tests don't contribute to it). | |
| run: > | |
| uv run pytest | |
| -m integration | |
| -v | |
| --tb=short | |
| --no-header | |
| -p no:cacheprovider | |
| -o addopts="" | |
| --junitxml=integration-results.xml | |
| - name: Upload test results | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: integration-test-results | |
| path: integration-results.xml | |
| retention-days: 30 |