refactor: rename minimumSockTimeMinutes to minimumSoakTimeMinutes (#973) #867
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: Apps / API | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: ["*"] | |
| paths: | |
| - apps/api/** | |
| - packages/** | |
| - e2e/** | |
| - .github/workflows/apps-api.yaml | |
| - pnpm-lock.yaml | |
| push: | |
| branches: ["main"] | |
| paths: | |
| - apps/api/** | |
| - packages/** | |
| - e2e/** | |
| - .github/workflows/apps-api.yaml | |
| - pnpm-lock.yaml | |
| jobs: | |
| build: | |
| uses: ./.github/workflows/build-image.yaml | |
| secrets: inherit | |
| with: | |
| image-name: ctrlplane/api | |
| dockerfile: apps/api/Dockerfile | |
| platform: "linux/amd64" | |
| api-tests: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| services: | |
| postgres: | |
| image: postgres:18 | |
| env: | |
| POSTGRES_USER: ctrlplane_test | |
| POSTGRES_PASSWORD: test_password | |
| POSTGRES_DB: ctrlplane_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| POSTGRES_URL: "postgresql://ctrlplane_test:test_password@localhost:5432/ctrlplane_test?sslmode=disable" | |
| AUTH_SECRET: "d0c1b54c50ccd3c89ee37e9c041f91748d361b09f8fd3b7fe542779c0f3f0983" | |
| AUTH_TRUST_HOST: "true" | |
| BASE_URL: "http://localhost:8080" | |
| VARIABLES_AES_256_KEY: "0000000000000000000000000000000000000000000000000000000000000000" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup | |
| uses: ./tooling/github/setup | |
| - name: Copy env | |
| run: | | |
| cp .env.example .env | |
| sed -i "s|POSTGRES_URL=.*|POSTGRES_URL=$POSTGRES_URL|" .env | |
| - name: Build | |
| run: pnpm build | |
| - name: Run migrations | |
| working-directory: packages/db | |
| run: pnpm exec drizzle-kit migrate | |
| - name: Seed test data | |
| run: pnpm -F @ctrlplane/e2e seed | |
| - name: Start API server | |
| run: pnpm -F @ctrlplane/web-api dev & | |
| env: | |
| PORT: "8080" | |
| - name: Wait for API server | |
| run: | | |
| timeout 60s bash -c 'until curl -sf http://localhost:8080/api/healthz; do sleep 2; done' | |
| - name: Run API tests | |
| run: pnpm -F @ctrlplane/e2e test:api | |
| env: | |
| BASE_URL: "http://localhost:8080" | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report | |
| path: e2e/playwright-report/ | |
| retention-days: 5 |