[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:
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 }}'
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
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