mirror of
https://github.com/twentyhq/twenty.git
synced 2026-08-01 10:12:06 -04:00
## What Removes the GitHub merge queue and runs what the queue used to gate — the E2E (Playwright) suite — directly on push to `main`. If that run fails on `main`, we ping engineering via webhook. ## Why In the queue, only the `e2e-test` job in `ci-merge-queue.yaml` ran real work — every other CI workflow's `merge_group` path skipped its `changed-files-check` and tests, so the queue's status checks for those were effectively green no-ops. The expensive thing actually gated was E2E. Moving it to `push: main` validates the merged state post-merge without the queue's batching overhead. ## Changes - **Rename** `ci-merge-queue.yaml` → `ci-e2e-main.yaml` (`name: CI E2E Main`). - `e2e-test` now triggers on `push` to `main` (the `run-merge-queue` PR label is kept as a manual opt-in for running E2E on a PR). - Status-check job renamed `ci-e2e-main-status-check`. - New `notify-main-ci-failure` job: on a failed **main push**, `POST`s to `https://engineering.twenty.com/s/main-ci-failing` with the commit SHA, actor, and run URL. - **Strip dead merge-queue config** from the other CI workflows: removed the `merge_group:` triggers and the now-unreachable `if: github.event_name != 'merge_group'` guards from `ci-server`, `ci-shared`, `ci-sdk`, `ci-front-component-renderer`, `ci-test-docker-compose`, `ci-website`, and the `merge_group:` trigger from `ci-front`, `ci-ui`, `ci-new-ui`. ## Required follow-up (not in this PR) The merge queue itself is a **repo setting**, not code. After this merges, disable **"Require merge queue"** on the `main` ruleset/branch protection (Settings → Rules), otherwise GitHub keeps batching. Required status checks tied to the old queue should also be dropped/updated. ## Behavior change E2E now runs **after** merge rather than blocking it in the queue — a bad change lands on `main` and then alerts (the webhook is the mitigation), instead of being held back pre-merge. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/twentyhq/twenty/pull/21722?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
156 lines
4.7 KiB
YAML
156 lines
4.7 KiB
YAML
name: CI E2E Main
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
pull_request:
|
|
types: [labeled, synchronize, opened, reopened]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
|
|
jobs:
|
|
e2e-test:
|
|
if: >
|
|
github.event_name == 'push' ||
|
|
(github.event_name == 'pull_request' &&
|
|
contains(github.event.pull_request.labels.*.name, 'run-merge-queue'))
|
|
runs-on: ubuntu-latest-8-cores
|
|
timeout-minutes: 30
|
|
env:
|
|
NODE_OPTIONS: "--max-old-space-size=10240"
|
|
services:
|
|
postgres:
|
|
image: postgres:18
|
|
env:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
redis:
|
|
image: redis
|
|
ports:
|
|
- 6379:6379
|
|
steps:
|
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
|
with:
|
|
fetch-depth: 10
|
|
|
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
with:
|
|
node-version: lts/*
|
|
|
|
- name: Install dependencies
|
|
uses: ./.github/actions/yarn-install
|
|
|
|
- name: Restore Nx build cache
|
|
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 (restore)
|
|
with:
|
|
key: v4-e2e-build-${{ github.ref_name }}-${{ github.sha }}
|
|
restore-keys: |
|
|
v4-e2e-build-${{ github.ref_name }}-
|
|
v4-e2e-build-main-
|
|
path: |
|
|
.nx
|
|
node_modules/.cache
|
|
packages/*/node_modules/.cache
|
|
|
|
- name: Build twenty-shared
|
|
run: npx nx build twenty-shared
|
|
|
|
- name: Install Playwright Browsers
|
|
run: npx nx setup twenty-e2e-testing
|
|
|
|
- name: Setup environment files
|
|
run: |
|
|
cp packages/twenty-front/.env.example packages/twenty-front/.env
|
|
npx nx reset:env:e2e-testing-server twenty-server
|
|
|
|
- name: Build frontend
|
|
run: NODE_ENV=production npx nx build twenty-front
|
|
|
|
- name: Build server
|
|
run: npx nx build twenty-server
|
|
|
|
- name: Save Nx build cache
|
|
if: always()
|
|
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 (save)
|
|
with:
|
|
key: v4-e2e-build-${{ github.ref_name }}-${{ github.sha }}
|
|
path: |
|
|
.nx
|
|
node_modules/.cache
|
|
packages/*/node_modules/.cache
|
|
|
|
- name: Create and setup database
|
|
run: |
|
|
PGPASSWORD=postgres psql -h localhost -p 5432 -U postgres -d postgres -c 'CREATE DATABASE "default";'
|
|
PGPASSWORD=postgres psql -h localhost -p 5432 -U postgres -d postgres -c 'CREATE DATABASE "test";'
|
|
npx nx run twenty-server:database:reset
|
|
|
|
- name: Start server
|
|
run: |
|
|
npx nx start twenty-server &
|
|
echo "Waiting for server to be ready..."
|
|
timeout 60 bash -c 'until curl -s http://localhost:3000/health; do sleep 2; done'
|
|
|
|
- name: Start frontend
|
|
run: |
|
|
npm_config_yes=true npx serve -s packages/twenty-front/build -l 3001 &
|
|
echo "Waiting for frontend to be ready..."
|
|
timeout 60 bash -c 'until curl -s http://localhost:3001; do sleep 2; done'
|
|
|
|
- name: Start worker
|
|
run: |
|
|
npx nx run twenty-server:worker &
|
|
echo "Worker started"
|
|
|
|
- name: Run Playwright tests
|
|
run: npx nx test twenty-e2e-testing
|
|
|
|
- name: Upload Playwright results
|
|
if: always()
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
name: playwright-results
|
|
path: |
|
|
packages/twenty-e2e-testing/run_results/
|
|
packages/twenty-e2e-testing/test-results/
|
|
retention-days: 7
|
|
|
|
ci-e2e-main-status-check:
|
|
if: always() && !cancelled()
|
|
timeout-minutes: 5
|
|
runs-on: ubuntu-latest
|
|
needs: [e2e-test]
|
|
steps:
|
|
- name: Fail job if any needs failed
|
|
if: contains(needs.*.result, 'failure')
|
|
run: exit 1
|
|
|
|
notify-main-ci-failure:
|
|
if: always() && github.event_name == 'push' && contains(needs.*.result, 'failure')
|
|
timeout-minutes: 5
|
|
runs-on: ubuntu-latest
|
|
needs: [e2e-test]
|
|
steps:
|
|
- name: Ping engineering on main CI failure
|
|
run: |
|
|
curl -fsS -X POST https://engineering.twenty.com/s/main-ci-failing \
|
|
-H 'Content-Type: application/json' \
|
|
-d '{
|
|
"commit": "${{ github.sha }}",
|
|
"actor": "${{ github.actor }}",
|
|
"run_url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
}'
|