diff --git a/.gitea/workflows/pipeline.yml b/.gitea/workflows/pipeline.yml index d086549..3e2f0a1 100644 --- a/.gitea/workflows/pipeline.yml +++ b/.gitea/workflows/pipeline.yml @@ -114,26 +114,31 @@ jobs: api-integration: name: API Integration Tests runs-on: ubuntu-latest + services: + postgres: + image: postgres:16 + env: + POSTGRES_USER: reactbin + POSTGRES_PASSWORD: reactbin + POSTGRES_DB: reactbin_test + options: >- + --health-cmd pg_isready + --health-interval 5s + --health-timeout 5s + --health-retries 10 steps: - uses: actions/checkout@v4 - - name: Start services + - name: Start MinIO run: | - docker run -d --name ci-postgres \ - --network container:$(hostname) \ - -e POSTGRES_USER=reactbin \ - -e POSTGRES_PASSWORD=reactbin \ - -e POSTGRES_DB=reactbin_test \ - postgres:16 docker run -d --name ci-minio \ --network container:$(hostname) \ -e MINIO_ROOT_USER=minioadmin \ -e MINIO_ROOT_PASSWORD=minioadmin \ quay.io/minio/minio server /data - - name: Wait for services and create bucket + - name: Create MinIO bucket run: | - until docker exec ci-postgres pg_isready -U reactbin; do sleep 2; done curl -fsSL https://dl.min.io/client/mc/release/linux-amd64/mc -o /tmp/mc chmod +x /tmp/mc until /tmp/mc alias set local http://localhost:9000 minioadmin minioadmin; do sleep 2; done @@ -159,8 +164,8 @@ jobs: run: uv run pytest tests/integration/ -q working-directory: api env: - TEST_DATABASE_URL: postgresql+asyncpg://reactbin:reactbin@localhost/reactbin_test - DATABASE_URL: postgresql+asyncpg://reactbin:reactbin@localhost/reactbin_test + TEST_DATABASE_URL: postgresql+asyncpg://reactbin:reactbin@postgres/reactbin_test + DATABASE_URL: postgresql+asyncpg://reactbin:reactbin@postgres/reactbin_test S3_ENDPOINT_URL: http://localhost:9000 S3_BUCKET_NAME: reactbin-test S3_ACCESS_KEY_ID: minioadmin @@ -171,9 +176,9 @@ jobs: OWNER_USERNAME: testowner OWNER_PASSWORD: testpass - - name: Stop services + - name: Stop MinIO if: always() - run: docker stop ci-postgres ci-minio || true && docker rm ci-postgres ci-minio || true + run: docker stop ci-minio || true && docker rm ci-minio || true # ── Image builds (tag-only, gated on all jobs) ────────────────────────────────