mirror of
https://github.com/twentyhq/twenty.git
synced 2026-09-17 00:22:48 -04:00
Changes confined to `packages/twenty-ui/**` could skip consumer CI, allowing sandbox regressions to reach main. Add that path to the renderer, SDK, and website workflows, which directly depend on the workspace UI package. Frontend and UI CI already cover the path. The Base UI 1.8 upgrade in #25615 introduced an `Element.matches(':disabled')` call that the renderer sandbox does not support ([CI failure](https://github.com/twentyhq/twenty/actions/runs/34342034359/job/102435795459?pr=25655)). Temporarily use the existing known-failure gallery checks with separate expectations for each runtime: React must fail exactly `CardPicker`, `Radio`, and `RadioGroup`; Preact must fail only `CardPicker`, while its radio controls render successfully. Unexpected failures and partial or complete fixes still fail the assertions, prompting an expectation update when sandbox support lands. Validation: - Checked eight workflow filters against UI source, stylesheet, and package-manifest changes, plus an unrelated documentation change. Renderer, SDK, and website filters match UI changes; email, server, create-app, and both example-app workflows keep their existing filters. The five reverted workflow files match the base branch exactly. - Actionlint reports no new diagnostics; existing local-action metadata errors remain. Two workflows also have pre-existing Prettier failures. The story formatting and `git diff --check` pass. - Replayed the current React and Preact input story tests in Chromium against the saved CI Storybook build. The original Preact expectation reproduces the linked CI failure; both stories pass with the runtime-specific expectations. Confirmed that Preact renders all three radio controls and that failure reports remain stable after waiting. Changed-story lint and formatting pass. The full suite was not rerun locally.
110 lines
4.1 KiB
YAML
110 lines
4.1 KiB
YAML
name: CI SDK
|
|
|
|
on:
|
|
pull_request:
|
|
merge_group:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
|
|
jobs:
|
|
changed-files-check:
|
|
if: github.event_name != 'merge_group'
|
|
uses: ./.github/workflows/changed-files.yaml
|
|
with:
|
|
files: |
|
|
packages/twenty-sdk/**
|
|
packages/twenty-client-sdk/**
|
|
packages/twenty-server/**
|
|
packages/twenty-ui/**
|
|
.github/workflows/ci-sdk.yaml
|
|
!packages/twenty-sdk/package.json
|
|
!packages/twenty-client-sdk/package.json
|
|
sdk-test:
|
|
needs: changed-files-check
|
|
if: needs.changed-files-check.outputs.any_changed == 'true'
|
|
timeout-minutes: 30
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
task: [lint, typecheck, test:unit, test:integration]
|
|
steps:
|
|
- name: Fetch custom Github Actions and base branch history
|
|
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
|
with:
|
|
fetch-depth: 10
|
|
- name: Install dependencies
|
|
uses: ./.github/actions/yarn-install
|
|
- name: Build
|
|
run: npx nx build twenty-sdk
|
|
- name: Run ${{ matrix.task }} task
|
|
uses: ./.github/actions/nx-affected
|
|
with:
|
|
tag: scope:sdk
|
|
tasks: ${{ matrix.task }}
|
|
sdk-e2e-test:
|
|
timeout-minutes: 30
|
|
runs-on: ubuntu-latest
|
|
needs: [changed-files-check, sdk-test]
|
|
if: needs.changed-files-check.outputs.any_changed == 'true'
|
|
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
|
|
env:
|
|
TWENTY_API_URL: http://localhost:3000
|
|
TWENTY_API_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyMDIwMjAyMC1lNmI1LTQ2ODAtOGEzMi1iODIwOTczNzE1NmIiLCJ1c2VySWQiOiIyMDIwMjAyMC1lNmI1LTQ2ODAtOGEzMi1iODIwOTczNzE1NmIiLCJ3b3Jrc3BhY2VJZCI6IjIwMjAyMDIwLTFjMjUtNGQwMi1iZjI1LTZhZWNjZjdlYTQxOSIsIndvcmtzcGFjZU1lbWJlcklkIjoiMjAyMDIwMjAtNDYzZi00MzViLTgyOGMtMTA3ZTAwN2EyNzExIiwidXNlcldvcmtzcGFjZUlkIjoiMjAyMDIwMjAtMWU3Yy00M2Q5LWE1ZGItNjg1YjUwNjlkODE2IiwidHlwZSI6IkFDQ0VTUyIsImF1dGhQcm92aWRlciI6InBhc3N3b3JkIiwiaWF0IjoxNzUxMjgxNzA0LCJleHAiOjIwNjY4NTc3MDR9.HMGqCsVlOAPVUBhKSGlD1X86VoHKt4LIUtET3CGIdik
|
|
steps:
|
|
- name: Fetch custom Github Actions and base branch history
|
|
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
|
with:
|
|
fetch-depth: 10
|
|
- name: Install dependencies
|
|
uses: ./.github/actions/yarn-install
|
|
- name: Build SDK
|
|
run: npx nx build twenty-sdk
|
|
- name: Setup server environment
|
|
run: npx nx reset:env:e2e-testing-server twenty-server
|
|
- name: Create databases
|
|
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";'
|
|
- name: Setup database
|
|
run: npx nx run twenty-server:database:reset
|
|
- name: Start server
|
|
run: nohup npx nx start:ci twenty-server > /tmp/twenty-server.log 2>&1 &
|
|
- name: Wait for server to be ready
|
|
run: npx wait-on http://localhost:3000/healthz --timeout 120000 --interval 1000
|
|
- name: SDK / Run e2e Tests
|
|
run: NODE_ENV=test npx vitest run --config ./vitest.e2e.config.ts
|
|
working-directory: packages/twenty-sdk
|
|
- name: Server / Dump logs on failure
|
|
if: failure()
|
|
run: tail -100 /tmp/twenty-server.log || echo "No server log file found"
|
|
ci-sdk-status-check:
|
|
if: always() && !cancelled()
|
|
timeout-minutes: 5
|
|
runs-on: ubuntu-latest
|
|
needs: [changed-files-check, sdk-test, sdk-e2e-test]
|
|
steps:
|
|
- name: Fail job if any needs failed
|
|
if: contains(needs.*.result, 'failure')
|
|
run: exit 1
|