diff --git a/.gitea/workflows/pipeline.yml b/.gitea/workflows/pipeline.yml index af8c25c..8f57db5 100644 --- a/.gitea/workflows/pipeline.yml +++ b/.gitea/workflows/pipeline.yml @@ -65,11 +65,12 @@ jobs: api-unit: name: API Unit Tests runs-on: ubuntu-latest - container: - image: ghcr.io/astral-sh/uv:python3.12-bookworm-slim steps: - uses: actions/checkout@v4 + - name: Install uv + run: pip install uv + - name: Cache uv store uses: actions/cache@v3 with: @@ -99,20 +100,16 @@ jobs: api-lint: name: API Lint runs-on: ubuntu-latest - container: - image: ghcr.io/astral-sh/uv:python3.12-bookworm-slim steps: - uses: actions/checkout@v4 - name: Run Ruff - run: uvx ruff check . + run: pip install uv && uvx ruff check . working-directory: api api-integration: name: API Integration Tests runs-on: ubuntu-latest - container: - image: ghcr.io/astral-sh/uv:python3.12-bookworm-slim services: postgres: image: postgres:16 @@ -120,20 +117,34 @@ jobs: POSTGRES_USER: reactbin POSTGRES_PASSWORD: reactbin POSTGRES_DB: reactbin_test + ports: + - 5432:5432 options: >- --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 10 - minio: - image: bitnami/minio:latest - env: - MINIO_ROOT_USER: minioadmin - MINIO_ROOT_PASSWORD: minioadmin - MINIO_DEFAULT_BUCKETS: reactbin-test steps: - uses: actions/checkout@v4 + - name: Start MinIO + run: | + docker run -d --name ci-minio \ + -e MINIO_ROOT_USER=minioadmin \ + -e MINIO_ROOT_PASSWORD=minioadmin \ + -p 9000:9000 \ + quay.io/minio/minio server /data + + - name: Create MinIO bucket + run: | + 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 + /tmp/mc mb local/reactbin-test + + - name: Install uv + run: pip install uv + - name: Cache uv store uses: actions/cache@v3 with: @@ -149,9 +160,9 @@ 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 - S3_ENDPOINT_URL: http://minio:9000 + 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 S3_SECRET_ACCESS_KEY: minioadmin @@ -161,6 +172,10 @@ jobs: OWNER_USERNAME: testowner OWNER_PASSWORD: testpass + - name: Stop MinIO + if: always() + run: docker stop ci-minio && docker rm ci-minio || true + # ── Image builds (tag-only, gated on all jobs) ──────────────────────────────── build-api: