fix(ci): reorganize workflow steps and move cache saving to correct s… (#13083)

…tage
This commit is contained in:
Antoine Moreaux
2025-07-07 18:06:25 +02:00
committed by GitHub
parent e4120cdce3
commit 29f7b74756
5 changed files with 33 additions and 21 deletions

View File

@ -20,6 +20,8 @@ jobs:
files: | files: |
package.json package.json
packages/twenty-server/** packages/twenty-server/**
packages/twenty-front/src/generated/**
packages/twenty-front/src/generated-metadata/**
packages/twenty-emails/** packages/twenty-emails/**
packages/twenty-shared/** packages/twenty-shared/**
server-setup: server-setup:
@ -67,10 +69,10 @@ jobs:
with: with:
tag: scope:backend tag: scope:backend
tasks: lint,typecheck tasks: lint,typecheck
- name: Server / Build
run: npx nx build twenty-server
- name: Server / Write .env - name: Server / Write .env
run: npx nx reset:env twenty-server run: npx nx reset:env twenty-server
- name: Server / Build
run: npx nx build twenty-server
- name: Server / Create DB - name: Server / Create DB
run: | 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 "default";'
@ -87,6 +89,20 @@ jobs:
# If worker failed for other reasons, fail the build # If worker failed for other reasons, fail the build
exit $exit_code exit $exit_code
fi fi
- name: Server / Start
run: npx nx start:ci twenty-server &
- name: Waiting for server starting...
run: |
for i in {1..10}; do
if curl -f http://localhost:3000/healthz; then
echo "Server ready!"
exit 0
fi
echo "Waiting..."
sleep 2
done
echo "Server did not become healthy in time" >&2
exit 1
- name: Server / Check for Pending Migrations - name: Server / Check for Pending Migrations
run: | run: |
CORE_MIGRATION_OUTPUT=$(npx nx run twenty-server:typeorm migration:generate core-migration-check -d src/database/typeorm/core/core.datasource.ts || true) CORE_MIGRATION_OUTPUT=$(npx nx run twenty-server:typeorm migration:generate core-migration-check -d src/database/typeorm/core/core.datasource.ts || true)
@ -101,23 +117,6 @@ jobs:
exit 1 exit 1
fi fi
- name: Save server setup
uses: ./.github/workflows/actions/save-cache
with:
key: ${{ steps.restore-server-setup-cache.outputs.cache-primary-key }}
graphql-check:
timeout-minutes: 10
runs-on: depot-ubuntu-24.04-8
needs: [server-setup, changed-files-check]
if: needs.changed-files-check.outputs.any_changed == 'true'
steps:
- name: Fetch custom Github Actions and base branch history
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
uses: ./.github/workflows/actions/yarn-install
- name: GraphQL / Check for Pending Generation - name: GraphQL / Check for Pending Generation
run: | run: |
# Run GraphQL generation commands # Run GraphQL generation commands
@ -129,7 +128,10 @@ jobs:
echo "::error::GraphQL schema changes detected. Please run 'npx nx run twenty-front:graphql:generate' and 'npx nx run twenty-front:graphql:generate --configuration=metadata' and commit the changes." echo "::error::GraphQL schema changes detected. Please run 'npx nx run twenty-front:graphql:generate' and 'npx nx run twenty-front:graphql:generate --configuration=metadata' and commit the changes."
exit 1 exit 1
fi fi
- name: Save server setup
uses: ./.github/workflows/actions/save-cache
with:
key: ${{ steps.restore-server-setup-cache.outputs.cache-primary-key }}
server-test: server-test:
timeout-minutes: 30 timeout-minutes: 30
runs-on: depot-ubuntu-24.04-8 runs-on: depot-ubuntu-24.04-8
@ -242,7 +244,7 @@ jobs:
if: always() && !cancelled() if: always() && !cancelled()
timeout-minutes: 5 timeout-minutes: 5
runs-on: depot-ubuntu-24.04-8 runs-on: depot-ubuntu-24.04-8
needs: [changed-files-check, server-setup, graphql-check, server-test, server-integration-test] needs: [changed-files-check, server-setup, server-test, server-integration-test]
steps: steps:
- name: Fail job if any needs failed - name: Fail job if any needs failed
if: contains(needs.*.result, 'failure') if: contains(needs.*.result, 'failure')

View File

@ -2561,6 +2561,7 @@ export type UserWorkspace = {
createdAt: Scalars['DateTime']; createdAt: Scalars['DateTime'];
deletedAt?: Maybe<Scalars['DateTime']>; deletedAt?: Maybe<Scalars['DateTime']>;
id: Scalars['UUID']; id: Scalars['UUID'];
locale: Scalars['String'];
objectPermissions?: Maybe<Array<ObjectPermission>>; objectPermissions?: Maybe<Array<ObjectPermission>>;
/** @deprecated Use objectPermissions instead */ /** @deprecated Use objectPermissions instead */
objectRecordsPermissions?: Maybe<Array<PermissionsOnAllObjectRecords>>; objectRecordsPermissions?: Maybe<Array<PermissionsOnAllObjectRecords>>;

View File

@ -2389,6 +2389,7 @@ export type UserWorkspace = {
createdAt: Scalars['DateTime']; createdAt: Scalars['DateTime'];
deletedAt?: Maybe<Scalars['DateTime']>; deletedAt?: Maybe<Scalars['DateTime']>;
id: Scalars['UUID']; id: Scalars['UUID'];
locale: Scalars['String'];
objectPermissions?: Maybe<Array<ObjectPermission>>; objectPermissions?: Maybe<Array<ObjectPermission>>;
/** @deprecated Use objectPermissions instead */ /** @deprecated Use objectPermissions instead */
objectRecordsPermissions?: Maybe<Array<PermissionsOnAllObjectRecords>>; objectRecordsPermissions?: Maybe<Array<PermissionsOnAllObjectRecords>>;

View File

@ -49,6 +49,13 @@
"command": "NODE_ENV=development && nest start --watch" "command": "NODE_ENV=development && nest start --watch"
} }
}, },
"start:ci": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/twenty-server",
"command": "NODE_ENV=development && nest start"
}
},
"start:debug": { "start:debug": {
"executor": "nx:run-commands", "executor": "nx:run-commands",
"dependsOn": ["build"], "dependsOn": ["build"],

View File

@ -3,6 +3,7 @@ export enum FeatureFlagKey {
IS_POSTGRESQL_INTEGRATION_ENABLED = 'IS_POSTGRESQL_INTEGRATION_ENABLED', IS_POSTGRESQL_INTEGRATION_ENABLED = 'IS_POSTGRESQL_INTEGRATION_ENABLED',
IS_STRIPE_INTEGRATION_ENABLED = 'IS_STRIPE_INTEGRATION_ENABLED', IS_STRIPE_INTEGRATION_ENABLED = 'IS_STRIPE_INTEGRATION_ENABLED',
IS_UNIQUE_INDEXES_ENABLED = 'IS_UNIQUE_INDEXES_ENABLED', IS_UNIQUE_INDEXES_ENABLED = 'IS_UNIQUE_INDEXES_ENABLED',
IS_JSON_FILTER_ENABLED = 'IS_JSON_FILTER_ENABLED',
IS_AI_ENABLED = 'IS_AI_ENABLED', IS_AI_ENABLED = 'IS_AI_ENABLED',
IS_IMAP_ENABLED = 'IS_IMAP_ENABLED', IS_IMAP_ENABLED = 'IS_IMAP_ENABLED',
IS_WORKFLOW_FILTERING_ENABLED = 'IS_WORKFLOW_FILTERING_ENABLED', IS_WORKFLOW_FILTERING_ENABLED = 'IS_WORKFLOW_FILTERING_ENABLED',