Repository navigation
checks #68
Workflow file for this run
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: CI provider benchmark | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| provider: | |
| description: Runner provider for this isolated test benchmark | |
| required: true | |
| default: github | |
| type: choice | |
| options: | |
| - github | |
| - blacksmith | |
| permissions: | |
| contents: read | |
| jobs: | |
| integration: | |
| name: integration (${{ matrix.provision }}, ${{ matrix.shard }}/8, ${{ | |
| inputs.provider }}) | |
| runs-on: ${{ inputs.provider == 'github' && 'ubuntu-24.04' || | |
| 'blacksmith-2vcpu-ubuntu-2404' }} | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| provision: | |
| - push | |
| - migrate | |
| shard: | |
| - 1 | |
| - 2 | |
| - 3 | |
| - 4 | |
| - 5 | |
| - 6 | |
| - 7 | |
| - 8 | |
| services: | |
| redis: | |
| image: redis:8.2-alpine | |
| ports: | |
| - 6379:6379 | |
| options: --health-cmd "redis-cli ping" --health-interval 5s --health-timeout 5s | |
| --health-retries 10 | |
| postgres: | |
| image: pgvector/pgvector:pg17 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: sim_test | |
| ports: | |
| - 5432:5432 | |
| options: --health-cmd "pg_isready -U postgres -d sim_test" --health-interval 5s | |
| --health-timeout 5s --health-retries 10 | |
| postgres-legacy: | |
| image: ${{ matrix.provision == 'push' && matrix.shard == 1 && | |
| 'postgres:16-alpine' || '' }} | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: sim_test | |
| ports: | |
| - 5433:5432 | |
| options: --health-cmd "pg_isready -U postgres -d sim_test" --health-interval 5s | |
| --health-timeout 5s --health-retries 10 | |
| env: | |
| TEST_DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/sim_test | |
| TEST_REDIS_URL: redis://127.0.0.1:6379 | |
| DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/sim_test | |
| BETTER_AUTH_SECRET: oauth-postgres-ci-secret-at-least-32-characters | |
| NEXT_PUBLIC_APP_URL: https://test.sim.ai | |
| ENCRYPTION_KEY: "0000000000000000000000000000000000000000000000000000000000000000" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| - name: Setup workspace | |
| uses: ./.github/actions/setup | |
| with: | |
| provider: ${{ inputs.provider }} | |
| - name: Provision a fresh database through the supported command | |
| working-directory: packages/db | |
| run: > | |
| bun -e 'import postgres from "postgres"; const sql = | |
| postgres(process.env.DATABASE_URL); for (const extension of ["vector", | |
| "btree_gin", "pg_trgm"]) await sql`CREATE EXTENSION IF NOT EXISTS | |
| ${sql(extension)}`; await sql.end()' | |
| bun run db:${{ matrix.provision }} | |
| - name: Verify migration replay is a no-op | |
| if: matrix.provision == 'migrate' && matrix.shard == 1 | |
| working-directory: packages/db | |
| run: bun run db:migrate | |
| - name: Run packages/db integration tests | |
| working-directory: packages/db | |
| run: bun run test --mode integration --shard=${{ matrix.shard }}/8 | |
| - name: Run apps/sim integration tests | |
| working-directory: apps/sim | |
| env: | |
| TZ: America/Los_Angeles | |
| run: /usr/bin/time -v bun run test --mode integration --shard=${{ matrix.shard | |
| }}/8 | |
| - name: Run apps/realtime integration tests | |
| if: matrix.shard == 1 | |
| working-directory: apps/realtime | |
| run: bun run test --mode integration | |
| - name: Verify cumulative billing timeout recovery on PostgreSQL 16 | |
| if: matrix.provision == 'push' && matrix.shard == 1 | |
| working-directory: apps/sim | |
| env: | |
| TEST_DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5433/sim_test | |
| run: bun run test --mode integration lib/billing/core/usage-log.integration.ts | |
| --outputFile.json=test-results/integration-pg16.json | |
| - name: Upload integration test reports | |
| if: always() | |
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 | |
| with: | |
| name: integration-reports-${{ matrix.provision }}-${{ matrix.shard }} | |
| path: | | |
| packages/db/test-results/*.json | |
| apps/sim/test-results/*.json | |
| apps/realtime/test-results/*.json | |
| if-no-files-found: warn | |
| retention-days: 14 |