Skip to content

Commit 032043a

Browse files
authoredMar 20, 2025
[TECH] optimisations de la CI
#11760
2 parents b80fab3 + b8829f7 commit 032043a

File tree

7 files changed

+567
-307
lines changed

7 files changed

+567
-307
lines changed
 

Diff for: ‎.circleci/config.yml

+38-63
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ executors:
4848
docker:
4949
- image: cimg/node:<<parameters.node-version>>
5050
resource_class: small
51+
node-docker-medium:
52+
parameters:
53+
node-version:
54+
# renovate datasource=node-version depName=node
55+
default: 22.14.0
56+
type: string
57+
docker:
58+
- image: cimg/node:<<parameters.node-version>>
59+
resource_class: medium
5160
node-redis-postgres-s3-docker:
5261
parameters:
5362
node-version:
@@ -89,7 +98,7 @@ executors:
8998
POSTGRES_USER: circleci
9099
POSTGRES_HOST_AUTH_METHOD: trust
91100
- image: redis:7.2.5-alpine
92-
resource_class: medium+
101+
resource_class: medium
93102
node-postgres-docker:
94103
parameters:
95104
node-version:
@@ -154,39 +163,39 @@ workflows:
154163
requires:
155164
- audit_logger_install
156165

157-
- mon_pix_install:
166+
- mon_pix_install_and_build:
158167
context: Pix
159168
requires:
160169
- checkout
161170
- mon_pix_lint:
162171
context: Pix
163172
requires:
164-
- mon_pix_install
173+
- mon_pix_install_and_build
165174
- mon_pix_test:
166175
context: Pix
167176
requires:
168-
- mon_pix_install
177+
- mon_pix_install_and_build
169178
- e2e_test_mon_pix:
170179
context: Pix
171180
requires:
172-
- checkout
181+
- mon_pix_install_and_build
173182

174-
- orga_install:
183+
- orga_install_and_build:
175184
context: Pix
176185
requires:
177186
- checkout
178187
- orga_lint:
179188
context: Pix
180189
requires:
181-
- orga_install
190+
- orga_install_and_build
182191
- orga_test:
183192
context: Pix
184193
requires:
185-
- orga_install
194+
- orga_install_and_build
186195
- e2e_test_orga:
187196
context: Pix
188197
requires:
189-
- checkout
198+
- orga_install_and_build
190199

191200
- certif_install:
192201
context: Pix
@@ -385,6 +394,7 @@ jobs:
385394
path: /home/circleci/test-results
386395
- store_artifacts:
387396
path: /home/circleci/test-results
397+
388398
api_integration_test:
389399
executor:
390400
name: node-redis-postgres-s3-docker
@@ -428,6 +438,7 @@ jobs:
428438
path: /home/circleci/test-results
429439
- store_artifacts:
430440
path: /home/circleci/test-results
441+
431442
api_acceptance_test:
432443
executor:
433444
name: node-redis-postgres-s3-docker
@@ -528,9 +539,9 @@ jobs:
528539
- store_artifacts:
529540
path: /home/circleci/test-results
530541

531-
mon_pix_install:
542+
mon_pix_install_and_build:
532543
executor:
533-
name: node-docker
544+
name: node-docker-medium
534545
working_directory: ~/pix/mon-pix
535546
steps:
536547
- attach_workspace:
@@ -540,6 +551,12 @@ jobs:
540551
keys:
541552
- v7-mon-pix-npm-{{ checksum "cachekey" }}
542553
- run: npm ci
554+
- run:
555+
name: Build Pix App
556+
command: npm run build
557+
environment:
558+
BUILD_ENVIRONMENT: development
559+
JOBS: 2
543560
- save_cache:
544561
key: v7-mon-pix-npm-{{ checksum "cachekey" }}
545562
paths:
@@ -581,9 +598,9 @@ jobs:
581598
- store_artifacts:
582599
path: /home/circleci/test-results/mon_pix
583600

584-
orga_install:
601+
orga_install_and_build:
585602
executor:
586-
name: node-docker
603+
name: node-docker-medium
587604
working_directory: ~/pix/orga
588605
steps:
589606
- attach_workspace:
@@ -593,6 +610,12 @@ jobs:
593610
keys:
594611
- v7-orga-npm-{{ checksum "cachekey" }}
595612
- run: npm ci
613+
- run:
614+
name: Build Pix Orga
615+
command: npm run build
616+
environment:
617+
BUILD_ENVIRONMENT: development
618+
JOBS: 2
596619
- save_cache:
597620
key: v7-orga-npm-{{ checksum "cachekey" }}
598621
paths:
@@ -811,11 +834,9 @@ jobs:
811834
key: v7-e2e-npm-{{ checksum "cachekey" }}
812835
paths:
813836
- ~/.npm
814-
815837
- run:
816838
name: Lint
817839
command: npm run lint
818-
819840
- run:
820841
working_directory: ~/pix/api
821842
command: cat package*.json > cachekey
@@ -826,20 +847,6 @@ jobs:
826847
name: Install Pix API
827848
working_directory: ~/pix/api
828849
command: npm ci
829-
830-
- run:
831-
working_directory: ~/pix/mon-pix
832-
command: cat package*.json > cachekey
833-
- restore_cache:
834-
keys:
835-
- v7-mon-pix-npm-{{ checksum "~/pix/mon-pix/cachekey" }}
836-
- run:
837-
name: Install Pix App
838-
environment:
839-
JOBS: 1
840-
working_directory: ~/pix/mon-pix
841-
command: npm ci
842-
843850
- run:
844851
name: Start Pix API
845852
working_directory: ~/pix/api
@@ -849,37 +856,29 @@ jobs:
849856
REDIS_URL: 'redis://localhost:6379'
850857
background: true
851858
command: npm start
852-
853859
- run:
854860
name: Start Pix App
855861
working_directory: ~/pix/mon-pix
856-
environment:
857-
JOBS: 1
862+
command: npx ember server --path=./dist --proxy=http://localhost:3000
858863
background: true
859-
command: npm start
860-
861864
- run:
862865
name: Prepare database
863866
working_directory: ~/pix/api
864867
environment:
865868
DATABASE_URL: 'postgres://circleci@localhost:5432/circleci'
866869
command: npm run db:prepare
867-
868870
- run:
869871
name: Refresh cache
870872
environment:
871-
JOBS: 1
872873
DATABASE_URL: 'postgres://circleci@localhost:5432/circleci'
873874
working_directory: ~/pix/api
874875
command: npm run cache:refresh
875-
876876
- run:
877877
name: Prepare datamart
878878
command: npm run datamart:prepare
879879
working_directory: ~/pix/api
880880
environment:
881881
DATAMART_DATABASE_URL: postgres://circleci@localhost:5432/circleci_datamart
882-
883882
- run:
884883
name: Run tests
885884
environment:
@@ -905,11 +904,9 @@ jobs:
905904
key: v7-e2e-npm-{{ checksum "cachekey" }}
906905
paths:
907906
- ~/.npm
908-
909907
- run:
910908
name: Lint
911909
command: npm run lint
912-
913910
- run:
914911
working_directory: ~/pix/api
915912
command: cat package*.json > cachekey
@@ -920,20 +917,6 @@ jobs:
920917
name: Install Pix API
921918
working_directory: ~/pix/api
922919
command: npm ci
923-
924-
- run:
925-
working_directory: ~/pix/orga
926-
command: cat package*.json > cachekey
927-
- restore_cache:
928-
keys:
929-
- v7-orga-npm-{{ checksum "~/pix/orga/cachekey" }}
930-
- run:
931-
name: Install Pix Orga
932-
environment:
933-
JOBS: 2
934-
working_directory: ~/pix/orga
935-
command: npm ci
936-
937920
- run:
938921
name: Start Pix API
939922
working_directory: ~/pix/api
@@ -943,37 +926,29 @@ jobs:
943926
REDIS_URL: 'redis://localhost:6379'
944927
background: true
945928
command: npm start
946-
947929
- run:
948930
name: Start Pix Orga
949931
working_directory: ~/pix/orga
950-
environment:
951-
JOBS: 2
932+
command: npx ember server --path=./dist --proxy=http://localhost:3000
952933
background: true
953-
command: npm start
954-
955934
- run:
956935
name: Prepare database
957936
working_directory: ~/pix/api
958937
environment:
959938
DATABASE_URL: 'postgres://circleci@localhost:5432/circleci'
960939
command: npm run db:prepare
961-
962940
- run:
963941
name: Refresh cache
964942
environment:
965-
JOBS: 1
966943
DATABASE_URL: 'postgres://circleci@localhost:5432/circleci'
967944
working_directory: ~/pix/api
968945
command: npm run cache:refresh
969-
970946
- run:
971947
name: Prepare datamart
972948
command: npm run datamart:prepare
973949
working_directory: ~/pix/api
974950
environment:
975951
DATAMART_DATABASE_URL: postgres://circleci@localhost:5432/circleci_datamart
976-
977952
- run:
978953
name: Run tests
979954
environment:

Diff for: ‎high-level-tests/e2e/cypress.config.cjs

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@ const {
55
preprendTransformerToOptions,
66
} = require("@badeball/cypress-cucumber-preprocessor/browserify");
77
const { configureVisualRegression } = require("cypress-visual-regression");
8+
const cypressSplit = require("cypress-split");
89

910
const SEQUENCE_RESTART_AT_NUMBER = 10000000;
1011

11-
async function setupNodeEvents(on, config) {
12+
async function setupNodeEvents(cypressOn, config) {
1213
config.env.AUTH_SECRET = process.env.AUTH_SECRET;
1314

15+
const on = require("cypress-on-fix")(cypressOn);
16+
17+
cypressSplit(on, config);
18+
1419
configureVisualRegression(on);
1520

1621
await preprocessor.addCucumberPreprocessorPlugin(on, config);
@@ -62,7 +67,6 @@ module.exports = defineConfig({
6267
video: false,
6368
blockHosts: ["*stats.pix.fr*", "*analytics.pix.fr*"],
6469
trashAssetsBeforeRuns: true,
65-
projectId: "3cjm89",
6670
numTestsKeptInMemory: 0,
6771
viewportWidth: 1500,
6872
retries: {

0 commit comments

Comments
 (0)