@@ -221,25 +221,25 @@ jobs:
221
221
- name : Build clients
222
222
run : cd clients/algoliasearch-client-javascript && yarn build
223
223
224
- # - name: Build the playground
225
- # run: yarn cli build playground javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }}
226
- #
227
- # - name: Build the browser playground
228
- # run: yarn workspace javascript-playground-browser build
229
- #
230
- # - name: Run common and requester tests
231
- # run: cd clients/algoliasearch-client-javascript && yarn test ${{ !contains(fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun, 'algoliasearch') && '--ignore algoliasearch' || '' }}
232
- #
233
- # - name: Test JavaScript bundle size
234
- # if: ${{ startsWith(github.head_ref, 'chore/prepare-release-') }}
235
- # run: cd clients/algoliasearch-client-javascript && yarn test:size
236
- #
237
- # - name: Test JavaScript bundle and types
238
- # if: ${{ startsWith(github.head_ref, 'chore/prepare-release-') }}
239
- # run: cd clients/algoliasearch-client-javascript && yarn test:bundle
240
- #
241
- # - name: Remove previous CTS output
242
- # run: rm -rf ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).testsToDelete }}
224
+ - name : Build the playground
225
+ run : yarn cli build playground javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }}
226
+
227
+ - name : Build the browser playground
228
+ run : yarn workspace javascript-playground-browser build
229
+
230
+ - name : Run common and requester tests
231
+ run : cd clients/algoliasearch-client-javascript && yarn test ${{ !contains(fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun, 'algoliasearch') && '--ignore algoliasearch' || '' }}
232
+
233
+ - name : Test JavaScript bundle size
234
+ if : ${{ startsWith(github.head_ref, 'chore/prepare-release-') }}
235
+ run : cd clients/algoliasearch-client-javascript && yarn test:size
236
+
237
+ - name : Test JavaScript bundle and types
238
+ if : ${{ startsWith(github.head_ref, 'chore/prepare-release-') }}
239
+ run : cd clients/algoliasearch-client-javascript && yarn test:bundle
240
+
241
+ - name : Remove previous CTS output
242
+ run : rm -rf ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).testsToDelete }}
243
243
244
244
- name : Generate CTS
245
245
run : yarn cli cts generate javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }}
@@ -265,30 +265,30 @@ jobs:
265
265
- name : Run unit CTS
266
266
run : yarn cli cts run javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }} --no-e2e
267
267
268
- # - name: Run e2e CTS
269
- # id: cts-e2e
270
- # continue-on-error: true
271
- # if: ${{ !github.event.pull_request.head.repo.fork && !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') }}
272
- # run: yarn cli cts run javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }} --no-client --no-requests
273
- #
274
- # - name: Retry e2e CTS
275
- # if: ${{ steps.cts-e2e.outcome == 'failure' }}
276
- # run: yarn cli cts run javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }} --no-client --no-requests
277
- #
278
- # - name: Run benchmarks
279
- # run: yarn cli cts run javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }} --benchmark --no-client --no-requests --no-e2e
268
+ - name : Run e2e CTS
269
+ id : cts-e2e
270
+ continue-on-error : true
271
+ if : ${{ !github.event.pull_request.head.repo.fork && !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') }}
272
+ run : yarn cli cts run javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }} --no-client --no-requests
273
+
274
+ - name : Retry e2e CTS
275
+ if : ${{ steps.cts-e2e.outcome == 'failure' }}
276
+ run : yarn cli cts run javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }} --no-client --no-requests
277
+
278
+ - name : Run benchmarks
279
+ run : yarn cli cts run javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }} --benchmark --no-client --no-requests --no-e2e
280
280
281
281
- name : Generate code snippets
282
282
run : yarn cli snippets javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }}
283
283
284
284
- name : Build the snippets to check validity
285
285
run : yarn cli build snippets javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }}
286
286
287
- # - name: Generate code guides
288
- # run: yarn cli guides javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }}
289
- #
290
- # - name: Build the guides to check validity
291
- # run: yarn cli build guides javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }}
287
+ - name : Generate code guides
288
+ run : yarn cli guides javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }}
289
+
290
+ - name : Build the guides to check validity
291
+ run : yarn cli build guides javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }}
292
292
293
293
- name : Zip artifact before storing
294
294
run : zip -r -y clients-javascript.zip clients/algoliasearch-client-javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).testsToStore }} ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).guidesToStore }} -x "**/node_modules**" "**/.yarn/cache/**" "**/.yarn/install-state.gz" "**/build/**" "**/dist/**" "**/.gradle/**" "**/bin/**" "**/.nx/**"
@@ -319,6 +319,8 @@ jobs:
319
319
ALGOLIA_APPLICATION_ID : ${{ secrets.ALGOLIA_APPLICATION_ID }}
320
320
ALGOLIA_ADMIN_KEY : ${{ secrets.ALGOLIA_ADMIN_KEY }}
321
321
MONITORING_API_KEY : ${{ secrets.MONITORING_API_KEY }}
322
+ outputs :
323
+ hasBreakingChanges : ${{ steps.breakingChanges.outputs.hasBreakingChanges }}
322
324
name : client ${{ matrix.client.language }}@${{ matrix.client.version }}
323
325
steps :
324
326
- uses : actions/checkout@v4
@@ -343,66 +345,69 @@ jobs:
343
345
if : ${{ matrix.client.language == 'php' && startsWith(github.head_ref, 'chore/renovateBaseBranch') && matrix.client.isMainVersion }}
344
346
run : cd ${{ matrix.client.path }} && composer update
345
347
346
- # - name: Check for file duplicates in Swift
347
- # if: ${{ matrix.client.language == 'swift' && matrix.client.isMainVersion }}
348
- # run: |
349
- # set -eo pipefail
350
- # cd clients/algoliasearch-client-swift
351
- # find Sources -type f | rev | cut -d '/' -f1 | rev | sort | uniq -d
352
- # [ $(find Sources -type f | rev | cut -d '/' -f1 | rev | sort | uniq -d | wc -l) -gt 0 ] && echo "Duplicates found" && exit 1 || echo "No duplicate found"
353
-
354
- # - name: Build the playground
355
- # run: yarn cli build playground ${{ matrix.client.language }}
356
-
357
- # - name: Run Java 'algoliasearch' public API validation
358
- # if: ${{ github.base_ref == 'main' && matrix.client.language == 'java' && matrix.client.isMainVersion && !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-bc]') }}
359
- # run: |
360
- # cd ${{ matrix.client.path }}
361
- # exit_code=0
362
- # ./gradlew :api:japicmp || exit_code=$?
363
- #
364
- # FILE=./api/build/reports/japi.txt
365
- #
366
- # if [[ -f "$FILE" ]]; then
367
- # cat $FILE
368
- # fi
369
- #
370
- # exit $exit_code
371
-
372
- # - name: Remove previous CTS output
373
- # run: rm -rf ${{ matrix.client.testsToDelete }} || true
348
+ - name : Check for file duplicates in Swift
349
+ if : ${{ matrix.client.language == 'swift' && matrix.client.isMainVersion }}
350
+ run : |
351
+ set -eo pipefail
352
+ cd clients/algoliasearch-client-swift
353
+ find Sources -type f | rev | cut -d '/' -f1 | rev | sort | uniq -d
354
+ [ $(find Sources -type f | rev | cut -d '/' -f1 | rev | sort | uniq -d | wc -l) -gt 0 ] && echo "Duplicates found" && exit 1 || echo "No duplicate found"
355
+
356
+ - name : Build the playground
357
+ run : yarn cli build playground ${{ matrix.client.language }}
358
+
359
+ - name : Run Java 'algoliasearch' public API validation
360
+ id : breakingChanges
361
+ if : ${{ github.base_ref == 'main' && matrix.client.language == 'java' && matrix.client.isMainVersion }}
362
+ run : |
363
+ cd ${{ matrix.client.path }}
364
+ exit_code=0
365
+ ./gradlew :api:japicmp || exit_code=$?
366
+
367
+ FILE=./api/build/reports/japi.txt
368
+
369
+ if [[ -f "$FILE" ]]; then
370
+ cat $FILE
371
+ fi
372
+
373
+ if [[ $exit_code -ne 0 ]]; then
374
+ echo "hasBreakingChanges=true" >> $GITHUB_OUTPUT
375
+ fi
376
+
377
+ - name : Remove previous CTS output
378
+ run : rm -rf ${{ matrix.client.testsToDelete }} || true
374
379
375
380
- name : Generate CTS
376
381
run : yarn cli cts generate ${{ matrix.client.language }} ${{ matrix.client.toRun }} --language-version ${{ matrix.client.version }}
377
382
378
383
- name : Run unit CTS
379
384
run : yarn cli cts run ${{ matrix.client.language }} ${{ matrix.client.toRun }} --no-e2e
380
385
381
- # - name: Run e2e CTS
382
- # id: cts-e2e
383
- # continue-on-error: true
384
- # if: ${{ !github.event.pull_request.head.repo.fork && !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') }}
385
- # run: yarn cli cts run ${{ matrix.client.language }} ${{ matrix.client.toRun }} --no-client --no-requests
386
- #
387
- # - name: Retry e2e CTS
388
- # if: ${{ steps.cts-e2e.outcome == 'failure' }}
389
- # run: yarn cli cts run ${{ matrix.client.language }} ${{ matrix.client.toRun }} --no-client --no-requests
390
- #
391
- # - name: Run benchmarks
392
- # if: ${{ matrix.client.isMainVersion }}
393
- # run: yarn cli cts run ${{ matrix.client.language }} ${{ matrix.client.toRun }} --benchmark --no-client --no-requests --no-e2e
386
+ - name : Run e2e CTS
387
+ id : cts-e2e
388
+ continue-on-error : true
389
+ if : ${{ !github.event.pull_request.head.repo.fork && !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') }}
390
+ run : yarn cli cts run ${{ matrix.client.language }} ${{ matrix.client.toRun }} --no-client --no-requests
391
+
392
+ - name : Retry e2e CTS
393
+ if : ${{ steps.cts-e2e.outcome == 'failure' }}
394
+ run : yarn cli cts run ${{ matrix.client.language }} ${{ matrix.client.toRun }} --no-client --no-requests
395
+
396
+ - name : Run benchmarks
397
+ if : ${{ matrix.client.isMainVersion }}
398
+ run : yarn cli cts run ${{ matrix.client.language }} ${{ matrix.client.toRun }} --benchmark --no-client --no-requests --no-e2e
394
399
395
400
- name : Generate code snippets
396
401
run : yarn cli snippets ${{ matrix.client.language }} ${{ matrix.client.toRun }}
397
402
398
403
- name : Build the snippets to check validity
399
404
run : yarn cli build snippets ${{ matrix.client.language }}
400
405
401
- # - name: Generate code guides
402
- # run: yarn cli guides ${{ matrix.client.language }} ${{ matrix.client.toRun }}
403
- #
404
- # - name: Build the guides to check validity
405
- # run: yarn cli build guides ${{ matrix.client.language }}
406
+ - name : Generate code guides
407
+ run : yarn cli guides ${{ matrix.client.language }} ${{ matrix.client.toRun }}
408
+
409
+ - name : Build the guides to check validity
410
+ run : yarn cli build guides ${{ matrix.client.language }}
406
411
407
412
- name : Zip artifact before storing
408
413
if : ${{ matrix.client.isMainVersion }}
@@ -431,33 +436,33 @@ jobs:
431
436
!contains(needs.*.result, 'failure')
432
437
outputs :
433
438
success : ${{ steps.setoutput.outputs.success }}
434
- name : client kotlin${{ needs.setup.outputs.RUN_MACOS_KOTLIN_BUILD == 'true' && format('@{0}', fromJSON(needs.setup.outputs.KOTLIN_DATA).version) || '' }} macos
439
+ name : client kotlin${{ format('@{0}', fromJSON(needs.setup.outputs.KOTLIN_DATA).version) }} macos
435
440
steps :
436
441
- uses : actions/checkout@v4
437
442
438
- # - name: Download specs artifacts
439
- # uses: ./scripts/ci/actions/restore-artifacts
440
- # with:
441
- # type: specs
442
- #
443
- # - name: Setup
444
- # uses: ./.github/actions/setup
445
- # with:
446
- # language: kotlin
447
- # version: ${{ fromJSON(needs.setup.outputs.KOTLIN_DATA).version }}
448
- #
449
- # - name: Generate clients
450
- # run: yarn cli generate kotlin ${{ fromJSON(needs.setup.outputs.KOTLIN_DATA).toRun }}
451
- #
452
- # - name: Build clients for macOS
453
- # id: build
454
- # continue-on-error: true
455
- # run: yarn cli build clients kotlin
456
- #
457
- # - name: Retry build
458
- # if: ${{ steps.build.outcome == 'failure' }}
459
- # run: yarn cli build clients kotlin
460
- #
443
+ - name : Download specs artifacts
444
+ uses : ./scripts/ci/actions/restore-artifacts
445
+ with :
446
+ type : specs
447
+
448
+ - name : Setup
449
+ uses : ./.github/actions/setup
450
+ with :
451
+ language : kotlin
452
+ version : ${{ fromJSON(needs.setup.outputs.KOTLIN_DATA).version }}
453
+
454
+ - name : Generate clients
455
+ run : yarn cli generate kotlin ${{ fromJSON(needs.setup.outputs.KOTLIN_DATA).toRun }}
456
+
457
+ - name : Build clients for macOS
458
+ id : build
459
+ continue-on-error : true
460
+ run : yarn cli build clients kotlin
461
+
462
+ - name : Retry build
463
+ if : ${{ steps.build.outcome == 'failure' }}
464
+ run : yarn cli build clients kotlin
465
+
461
466
- name : Set output
462
467
id : setoutput
463
468
run : echo "success=true" >> "$GITHUB_OUTPUT"
@@ -481,38 +486,38 @@ jobs:
481
486
MONITORING_API_KEY : ${{ secrets.MONITORING_API_KEY }}
482
487
outputs :
483
488
success : ${{ steps.setoutput.outputs.success }}
484
- name : client swift${{ needs.setup.outputs.RUN_MACOS_SWIFT_CTS == 'true' && format('@{0}', fromJSON(needs.setup.outputs.SWIFT_DATA).version) || '' }} macos
489
+ name : client swift${{ format('@{0}', fromJSON(needs.setup.outputs.SWIFT_DATA).version) }} macos
485
490
steps :
486
491
- uses : actions/checkout@v4
487
492
if : ${{ env.ALGOLIA_APPLICATION_ID != '' }}
488
493
489
- # - name: Download specs artifacts
490
- # uses: ./scripts/ci/actions/restore-artifacts
491
- # with:
492
- # type: specs
493
- #
494
- # - name: Setup
495
- # uses: ./.github/actions/setup
496
- # if: ${{ env.ALGOLIA_APPLICATION_ID != '' }}
497
- # with:
498
- # language: swift
499
- # version: ${{ fromJSON(needs.setup.outputs.SWIFT_DATA).version }}
500
- #
501
- # - name: Generate clients
502
- # run: yarn cli generate swift ${{ fromJSON(needs.setup.outputs.SWIFT_DATA).toRun }}
503
- #
504
- # - name: Generate tests
505
- # run: yarn cli cts generate swift ${{ fromJSON(needs.setup.outputs.SWIFT_DATA).toRun }}
506
- #
507
- # - name: Run tests on macOS
508
- # id: run-test
509
- # if: ${{ env.ALGOLIA_APPLICATION_ID != '' }}
510
- # continue-on-error: true
511
- # run: yarn cli cts run swift ${{ fromJSON(needs.setup.outputs.SWIFT_DATA).toRun }} -v ${{ !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') && '--no-e2e' || '' }}
512
- #
513
- # - name: Retry tests
514
- # if: ${{ steps.run-test.outcome == 'failure' }}
515
- # run: yarn cli cts run swift ${{ fromJSON(needs.setup.outputs.SWIFT_DATA).toRun }} -v ${{ !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') && '--no-e2e' || '' }}
494
+ - name : Download specs artifacts
495
+ uses : ./scripts/ci/actions/restore-artifacts
496
+ with :
497
+ type : specs
498
+
499
+ - name : Setup
500
+ uses : ./.github/actions/setup
501
+ if : ${{ env.ALGOLIA_APPLICATION_ID != '' }}
502
+ with :
503
+ language : swift
504
+ version : ${{ fromJSON(needs.setup.outputs.SWIFT_DATA).version }}
505
+
506
+ - name : Generate clients
507
+ run : yarn cli generate swift ${{ fromJSON(needs.setup.outputs.SWIFT_DATA).toRun }}
508
+
509
+ - name : Generate tests
510
+ run : yarn cli cts generate swift ${{ fromJSON(needs.setup.outputs.SWIFT_DATA).toRun }}
511
+
512
+ - name : Run tests on macOS
513
+ id : run-test
514
+ if : ${{ env.ALGOLIA_APPLICATION_ID != '' }}
515
+ continue-on-error : true
516
+ run : yarn cli cts run swift ${{ fromJSON(needs.setup.outputs.SWIFT_DATA).toRun }} -v ${{ !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') && '--no-e2e' || '' }}
517
+
518
+ - name : Retry tests
519
+ if : ${{ steps.run-test.outcome == 'failure' }}
520
+ run : yarn cli cts run swift ${{ fromJSON(needs.setup.outputs.SWIFT_DATA).toRun }} -v ${{ !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') && '--no-e2e' || '' }}
516
521
517
522
- name : Set output
518
523
id : setoutput
@@ -586,12 +591,25 @@ jobs:
586
591
GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
587
592
PR_NUMBER : ${{ github.event.number }}
588
593
594
+ - name : Check for breaking changes
595
+ id : breakingChanges
596
+ if : ${{ needs.client_gen.outputs.hasBreakingChanges == 'true' }}
597
+ run : |
598
+ {
599
+ echo 'BREAKING_CHANGES_SECTION<<EOF'
600
+ echo "# 💥 Breaking changes detected !!"
601
+ echo "Either this PR or a previous PR not released yet introduced breaking changes, be careful when merging."
602
+ echo "You can find the details in the 'client java@17' CI job."
603
+ echo 'EOF'
604
+ } >> "$GITHUB_OUTPUT"
605
+
589
606
- name : update generation comment
590
607
uses : marocchino/sticky-pull-request-comment@v2
591
608
if : ${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT == '' }}
592
609
with :
593
610
GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
594
611
message : |
612
+ ${{ steps.breakingChanges.outputs.BREAKING_CHANGES_SECTION }}
595
613
### No code generated
596
614
597
615
_If you believe code should've been generated, please, [report the issue](https://github.com/algolia/api-clients-automation/issues/new?assignees=&labels=bug%2Ctriage&projects=&template=Bug_report.yml&title=%5Bbug%5D%3A+)._
@@ -604,6 +622,7 @@ jobs:
604
622
with :
605
623
GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
606
624
message : |
625
+ ${{ steps.breakingChanges.outputs.BREAKING_CHANGES_SECTION }}
607
626
### ✔️ Code generated!
608
627
609
628
| Name | Link |
0 commit comments