Skip to content

Commit fded8fe

Browse files
committed
CI: Add interruptible jobs, auto-cancel, and reduce MR test matrix
1 parent 1ed8764 commit fded8fe

1 file changed

Lines changed: 67 additions & 27 deletions

File tree

engine/.gitlab-ci.yml

Lines changed: 67 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1+
# Auto-cancel redundant pipelines when new commits are pushed
2+
workflow:
3+
auto_cancel:
4+
on_new_commit: interruptible
5+
rules:
6+
- if: $CI_COMMIT_TAG
7+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
8+
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
9+
110
default:
211
image:
312
name: golang:1.24
413
pull_policy: if-not-present
14+
interruptible: true # All jobs can be cancelled by default
515

616
stages:
717
- test
@@ -21,10 +31,12 @@ stages:
2131
- engine/**/*
2232

2333
.only_dle_tag_release: &only_tag_release
34+
interruptible: false # Never cancel release jobs
2435
rules:
2536
- if: $CI_COMMIT_TAG =~ /^v[0-9.]+$/
2637

2738
.only_dle_tag_rc: &only_tag_rc
39+
interruptible: false # Never cancel RC release jobs
2840
rules:
2941
- if: $CI_COMMIT_TAG =~ /^v[0-9.]+[\-_]*[a-zA-Z]+[a-zA-Z0-9.\-_]*[a-zA-Z0-9]+$/
3042

@@ -408,16 +420,11 @@ build-image-swagger-release:
408420
- export CLEAN_TAG=$(echo ${CI_COMMIT_TAG#"v"})
409421
- export TAGS="${DOCKER_IMAGE_NAME}:${CLEAN_TAG}"
410422

411-
.bash-test: &bash_test
423+
# Base template for bash integration tests
424+
.bash-test-base: &bash_test_base
412425
stage: integration-test
413426
variables:
414427
IMAGE_TAG: "${CI_COMMIT_REF_SLUG}"
415-
rules:
416-
- if: '$CI_PROJECT_NAMESPACE != "postgres-ai"'
417-
when: never
418-
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
419-
changes:
420-
- engine/**/*
421428
artifacts:
422429
paths:
423430
- engine/bin
@@ -432,53 +439,86 @@ build-image-swagger-release:
432439
tags:
433440
- dle-test
434441

435-
bash-test-9-6:
436-
<<: *bash_test
442+
# MR pipelines: Only run PG 17 and PG 18 to reduce queue time
443+
# (10 jobs competing for 2 runners was causing 35+ min queue times)
444+
.bash-test-mr: &bash_test_mr
445+
<<: *bash_test_base
446+
rules:
447+
- if: '$CI_PROJECT_NAMESPACE != "postgres-ai"'
448+
when: never
449+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
450+
changes:
451+
- engine/**/*
452+
453+
# Main branch: Run full test matrix for comprehensive coverage
454+
.bash-test-main: &bash_test_main
455+
<<: *bash_test_base
456+
rules:
457+
- if: '$CI_PROJECT_NAMESPACE != "postgres-ai"'
458+
when: never
459+
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
460+
changes:
461+
- engine/**/*
462+
463+
# MR jobs - only PG 17 and PG 18 (latest stable versions)
464+
bash-test-17:
465+
<<: *bash_test_mr
466+
variables:
467+
POSTGRES_VERSION: 17
468+
469+
bash-test-18:
470+
<<: *bash_test_mr
471+
variables:
472+
POSTGRES_VERSION: 18
473+
474+
# Main branch jobs - full matrix (all PostgreSQL versions)
475+
bash-test-main-9-6:
476+
<<: *bash_test_main
437477
variables:
438478
POSTGRES_VERSION: "9.6"
439479

440-
bash-test-10:
441-
<<: *bash_test
480+
bash-test-main-10:
481+
<<: *bash_test_main
442482
variables:
443483
POSTGRES_VERSION: 10
444484

445-
bash-test-11:
446-
<<: *bash_test
485+
bash-test-main-11:
486+
<<: *bash_test_main
447487
variables:
448488
POSTGRES_VERSION: 11
449489

450-
bash-test-12:
451-
<<: *bash_test
490+
bash-test-main-12:
491+
<<: *bash_test_main
452492
variables:
453493
POSTGRES_VERSION: 12
454494

455-
bash-test-13:
456-
<<: *bash_test
495+
bash-test-main-13:
496+
<<: *bash_test_main
457497
variables:
458498
POSTGRES_VERSION: 13
459499

460-
bash-test-14:
461-
<<: *bash_test
500+
bash-test-main-14:
501+
<<: *bash_test_main
462502
variables:
463503
POSTGRES_VERSION: 14
464504

465-
bash-test-15:
466-
<<: *bash_test
505+
bash-test-main-15:
506+
<<: *bash_test_main
467507
variables:
468508
POSTGRES_VERSION: 15
469509

470-
bash-test-16:
471-
<<: *bash_test
510+
bash-test-main-16:
511+
<<: *bash_test_main
472512
variables:
473513
POSTGRES_VERSION: 16
474514

475-
bash-test-17:
476-
<<: *bash_test
515+
bash-test-main-17:
516+
<<: *bash_test_main
477517
variables:
478518
POSTGRES_VERSION: 17
479519

480-
bash-test-18:
481-
<<: *bash_test
520+
bash-test-main-18:
521+
<<: *bash_test_main
482522
variables:
483523
POSTGRES_VERSION: 18
484524

0 commit comments

Comments
 (0)