From 3233734d2cc773858e32cfa764ce5186521d896d Mon Sep 17 00:00:00 2001 From: Paul Rastoin <45004772+prastoin@users.noreply.github.com> Date: Wed, 11 Jun 2025 16:05:40 +0200 Subject: [PATCH] [CI] Jest sharding integration tests (#12400) # Introduction Introducing jest sharding along github actions matrix in order to fluidify the process Note in case we will compute and guard coverage metrics we will need to merge coverages reports such as we do for the frontend storybooks integrations tests, from now this is overkill as unused Related successful run https://github.com/twentyhq/twenty/actions/runs/15585113583/job/43889477889 --- .github/workflows/actions/nx-affected/action.yaml | 5 +++-- .github/workflows/ci-server.yaml | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/actions/nx-affected/action.yaml b/.github/workflows/actions/nx-affected/action.yaml index c87a8a1e3..dfb664430 100644 --- a/.github/workflows/actions/nx-affected/action.yaml +++ b/.github/workflows/actions/nx-affected/action.yaml @@ -10,7 +10,8 @@ inputs: configuration: required: false default: 'ci' - + args: + required: false runs: using: "composite" steps: @@ -18,4 +19,4 @@ runs: uses: nrwl/nx-set-shas@v4 - name: Run affected command shell: bash - run: npx nx affected --nxBail --configuration=${{ inputs.configuration }} -t=${{ inputs.tasks }} --parallel=${{ inputs.parallel }} --exclude='*,!tag:${{ inputs.tag }}' \ No newline at end of file + run: npx nx affected --nxBail --configuration=${{ inputs.configuration }} -t=${{ inputs.tasks }} --parallel=${{ inputs.parallel }} --exclude='*,!tag:${{ inputs.tag }}' ${{ inputs.args }} \ No newline at end of file diff --git a/.github/workflows/ci-server.yaml b/.github/workflows/ci-server.yaml index c20f343ce..d25cc122f 100644 --- a/.github/workflows/ci-server.yaml +++ b/.github/workflows/ci-server.yaml @@ -145,6 +145,10 @@ jobs: timeout-minutes: 30 runs-on: depot-ubuntu-24.04-8 needs: server-setup + strategy: + fail-fast: false + matrix: + shard: [1, 2, 3, 4] services: postgres: image: twentycrm/twenty-postgres-spilo @@ -183,6 +187,7 @@ jobs: ANALYTICS_ENABLED: true CLICKHOUSE_URL: "http://default:clickhousePassword@localhost:8123/twenty" CLICKHOUSE_PASSWORD: clickhousePassword + SHARD_COUNTER: 4 steps: - name: Fetch custom Github Actions and base branch history uses: actions/checkout@v4 @@ -220,12 +225,7 @@ jobs: tag: scope:backend tasks: 'test:integration' configuration: 'with-db-reset' - - name: Server / Upload reset-logs file - if: always() - uses: actions/upload-artifact@v4 - with: - name: reset-logs - path: reset-logs.log + args: --shard=${{ matrix.shard }}/${{ env.SHARD_COUNTER }} ci-server-status-check: if: always() && !cancelled() timeout-minutes: 5