diff --git a/.gitea/workflows/pipeline.yml b/.gitea/workflows/pipeline.yml index 3e2f0a1..929c0d3 100644 --- a/.gitea/workflows/pipeline.yml +++ b/.gitea/workflows/pipeline.yml @@ -114,31 +114,27 @@ 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 + timeout-minutes: 15 steps: - uses: actions/checkout@v4 - - name: Start MinIO + - name: Start services 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: Create MinIO bucket + - name: Wait for services and create 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 @@ -164,8 +160,8 @@ jobs: run: uv run pytest tests/integration/ -q working-directory: api env: - TEST_DATABASE_URL: postgresql+asyncpg://reactbin:reactbin@postgres/reactbin_test - DATABASE_URL: postgresql+asyncpg://reactbin:reactbin@postgres/reactbin_test + TEST_DATABASE_URL: postgresql+asyncpg://reactbin:reactbin@localhost/reactbin_test + DATABASE_URL: postgresql+asyncpg://reactbin:reactbin@localhost/reactbin_test S3_ENDPOINT_URL: http://localhost:9000 S3_BUCKET_NAME: reactbin-test S3_ACCESS_KEY_ID: minioadmin @@ -176,9 +172,9 @@ jobs: OWNER_USERNAME: testowner OWNER_PASSWORD: testpass - - name: Stop MinIO + - name: Stop services if: always() - run: docker stop ci-minio || true && docker rm ci-minio || true + run: docker stop ci-postgres ci-minio || true && docker rm ci-postgres ci-minio || true # ── Image builds (tag-only, gated on all jobs) ────────────────────────────────