Repository navigation
checks #77
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: checks | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| actions: read | |
| jobs: | |
| e2e: | |
| name: e2e (${{ matrix.group }}) | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| group: [scim] | |
| services: | |
| 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 | |
| # Desktop inbox and Project Files use Redis. | |
| redis: | |
| image: ${{ (matrix.group == 'desktop-inbox' || matrix.group == 'project-files') && 'redis:8.2-alpine' || '' }} | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| env: | |
| DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/sim_test | |
| BETTER_AUTH_SECRET: http-e2e-ci-secret-at-least-32-characters | |
| E2E_APP_SERVER: start | |
| E2E_APP_PUBLIC_URL: ${{ matrix.group == 'scim' && 'http://scim-e2e.sim.ai:3017' || '' }} | |
| INTERNAL_API_BASE_URL: ${{ matrix.group == 'scim' && 'http://127.0.0.1:3017' || '' }} | |
| TRUSTED_ORIGINS: ${{ matrix.group == 'scim' && 'http://127.0.0.1:3017' || '' }} | |
| PROJECT_FILES_E2E_APP_SERVER: start | |
| ENCRYPTION_KEY: '0000000000000000000000000000000000000000000000000000000000000000' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 | |
| - name: Setup workspace | |
| uses: ./.github/actions/setup | |
| with: | |
| provider: blacksmith | |
| # Migrations create their own extensions, as on a fresh self-hosted install. | |
| - name: Provision the database through migrations | |
| if: matrix.group != 'project-files' | |
| working-directory: packages/db | |
| run: bun run db:migrate | |
| - name: Download the production build | |
| uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 | |
| with: | |
| name: next-build | |
| run-id: 39732335548 | |
| github-token: ${{ github.token }} | |
| path: ${{ runner.temp }} | |
| # A hosted build (NEXT_PUBLIC_APP_URL on sim.ai) prerenders every post; the build production | |
| # images use prerenders none. The URL itself is no marker: next.config's redirects name | |
| # www.sim.ai in every build. | |
| - name: Extract the production build | |
| run: | | |
| tar -I zstd -xf "$RUNNER_TEMP/next-build.tar.zst" -C apps/sim | |
| jq -e '[.routes[].srcRoute] | any(. == "/blog/[slug]" or . == "/library/[slug]") | not' \ | |
| apps/sim/.next/prerender-manifest.json > /dev/null || | |
| { echo "::error::The build prerendered posts (a hosted build) or has no prerender manifest."; exit 1; } | |
| # JOBS=4 caps node-gyp parallelism as docker/app.Dockerfile does (laverdet/isolated-vm#428). | |
| - name: Build native isolate addon for Project file rendering | |
| if: matrix.group == 'project-files' | |
| working-directory: apps/sim | |
| env: | |
| JOBS: 4 | |
| run: | | |
| addon_dir="$(node -p 'require("node:path").dirname(require.resolve("isolated-vm/package.json", { paths: ["."] }))')" | |
| cd "$addon_dir" | |
| bun run install | |
| - name: Map the hosted SCIM fixture to loopback | |
| if: matrix.group == 'scim' | |
| run: printf '127.0.0.1 scim-e2e.sim.ai\n' | sudo tee -a /etc/hosts | |
| # No step timeout: the job's bound covers a hang without cutting a slow but healthy suite | |
| # short of writing its report. | |
| - name: Run end-to-end suites | |
| working-directory: apps/sim | |
| run: bash ../../.github/scripts/http-e2e.sh "${{ matrix.group }}" | |
| - name: Upload acceptance timing and coverage reports | |
| if: always() | |
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | |
| with: | |
| name: e2e-reports-${{ matrix.group }} | |
| path: ${{ runner.temp }}/e2e/**/*.json | |
| if-no-files-found: ignore | |
| retention-days: 7 | |
| - name: Upload end-to-end reports and server logs | |
| if: failure() | |
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | |
| with: | |
| name: http-e2e-${{ matrix.group }} | |
| path: ${{ runner.temp }}/e2e/ | |
| if-no-files-found: ignore | |
| retention-days: 7 |