Migrate attachments to morph relations + fix morph join column filtering #4935
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 SDK | |
| on: | |
| merge_group: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| changed-files-check: | |
| uses: ./.github/workflows/changed-files.yaml | |
| with: | |
| files: | | |
| packages/twenty-sdk/** | |
| 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: Cancel Previous Runs | |
| uses: styfle/cancel-workflow-action@0.11.0 | |
| with: | |
| access_token: ${{ github.token }} | |
| - name: Fetch custom Github Actions and base branch history | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - 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 }} | |
| # TODO: Re-enable sdk-e2e-test once application sync is stable | |
| # sdk-e2e-test: | |
| # timeout-minutes: 30 | |
| # runs-on: depot-ubuntu-24.04-8 | |
| # needs: [changed-files-check, sdk-test] | |
| # if: needs.changed-files-check.outputs.any_changed == 'true' | |
| # services: | |
| # postgres: | |
| # image: twentycrm/twenty-postgres-spilo | |
| # env: | |
| # PGUSER_SUPERUSER: postgres | |
| # PGPASSWORD_SUPERUSER: postgres | |
| # ALLOW_NOSSL: 'true' | |
| # SPILO_PROVIDER: 'local' | |
| # ports: | |
| # - 5432:5432 | |
| # options: >- | |
| # --health-cmd pg_isready | |
| # --health-interval 10s | |
| # --health-timeout 5s | |
| # --health-retries 5 | |
| # redis: | |
| # image: redis | |
| # ports: | |
| # - 6379:6379 | |
| # env: | |
| # NODE_ENV: test | |
| # steps: | |
| # - name: Fetch custom Github Actions and base branch history | |
| # uses: actions/checkout@v4 | |
| # with: | |
| # fetch-depth: 0 | |
| # - name: Install dependencies | |
| # uses: ./.github/actions/yarn-install | |
| # - name: Server / Append billing config to .env.test | |
| # working-directory: packages/twenty-server | |
| # run: | | |
| # echo "" >> .env.test | |
| # echo "IS_BILLING_ENABLED=true" >> .env.test | |
| # echo "BILLING_STRIPE_API_KEY=test-api-key" >> .env.test | |
| # echo "BILLING_STRIPE_BASE_PLAN_PRODUCT_ID=test-base-plan-product-id" >> .env.test | |
| # echo "BILLING_STRIPE_WEBHOOK_SECRET=test-webhook-secret" >> .env.test | |
| # echo "BILLING_PLAN_REQUIRED_LINK=http://localhost:3001/stripe-redirection" >> .env.test | |
| # - name: Server / Create Test DB | |
| # run: | | |
| # PGPASSWORD=postgres psql -h localhost -p 5432 -U postgres -d postgres -c 'CREATE DATABASE "test";' | |
| # - name: SDK / Run E2E Tests | |
| # run: npx nx test:e2e twenty-sdk | |
| ci-sdk-status-check: | |
| if: always() && !cancelled() | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-latest | |
| needs: [changed-files-check, sdk-test] | |
| steps: | |
| - name: Fail job if any needs failed | |
| if: contains(needs.*.result, 'failure') | |
| run: exit 1 |