[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
This commit is contained in:
Paul Rastoin
2025-06-11 16:05:40 +02:00
committed by GitHub
parent c8ad9f149c
commit 3233734d2c
2 changed files with 9 additions and 8 deletions

View File

@ -10,7 +10,8 @@ inputs:
configuration: configuration:
required: false required: false
default: 'ci' default: 'ci'
args:
required: false
runs: runs:
using: "composite" using: "composite"
steps: steps:
@ -18,4 +19,4 @@ runs:
uses: nrwl/nx-set-shas@v4 uses: nrwl/nx-set-shas@v4
- name: Run affected command - name: Run affected command
shell: bash shell: bash
run: npx nx affected --nxBail --configuration=${{ inputs.configuration }} -t=${{ inputs.tasks }} --parallel=${{ inputs.parallel }} --exclude='*,!tag:${{ inputs.tag }}' run: npx nx affected --nxBail --configuration=${{ inputs.configuration }} -t=${{ inputs.tasks }} --parallel=${{ inputs.parallel }} --exclude='*,!tag:${{ inputs.tag }}' ${{ inputs.args }}

View File

@ -145,6 +145,10 @@ jobs:
timeout-minutes: 30 timeout-minutes: 30
runs-on: depot-ubuntu-24.04-8 runs-on: depot-ubuntu-24.04-8
needs: server-setup needs: server-setup
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
services: services:
postgres: postgres:
image: twentycrm/twenty-postgres-spilo image: twentycrm/twenty-postgres-spilo
@ -183,6 +187,7 @@ jobs:
ANALYTICS_ENABLED: true ANALYTICS_ENABLED: true
CLICKHOUSE_URL: "http://default:clickhousePassword@localhost:8123/twenty" CLICKHOUSE_URL: "http://default:clickhousePassword@localhost:8123/twenty"
CLICKHOUSE_PASSWORD: clickhousePassword CLICKHOUSE_PASSWORD: clickhousePassword
SHARD_COUNTER: 4
steps: steps:
- name: Fetch custom Github Actions and base branch history - name: Fetch custom Github Actions and base branch history
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -220,12 +225,7 @@ jobs:
tag: scope:backend tag: scope:backend
tasks: 'test:integration' tasks: 'test:integration'
configuration: 'with-db-reset' configuration: 'with-db-reset'
- name: Server / Upload reset-logs file args: --shard=${{ matrix.shard }}/${{ env.SHARD_COUNTER }}
if: always()
uses: actions/upload-artifact@v4
with:
name: reset-logs
path: reset-logs.log
ci-server-status-check: ci-server-status-check:
if: always() && !cancelled() if: always() && !cancelled()
timeout-minutes: 5 timeout-minutes: 5