Skip to content

Commit 7857e12

Browse files
committed
.gitlab-ci.yml: Honour AUTOBUILD_SKIP_SAMBA_O3 in GitLab CI
GitLab CI resources are expensive and often rationed so provide a way to test other things without testing an -O3 build also, as this will save 9 jobs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14861 Signed-off-by: Andrew Bartlett <[email protected]> Reviewed-by: Ralph Boehme <[email protected]>
1 parent fc2347b commit 7857e12

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

.gitlab-ci-default.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ variables:
33
# "--enable-coverage" or ""
44
# See .gitlab-ci-coverage.yml
55
SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE: ""
6+
AUTOBUILD_SKIP_SAMBA_O3: "0"
67

78
include:
89
- /.gitlab-ci-default-runners.yml

.gitlab-ci-main.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,16 +514,24 @@ ubuntu1804-samba-o3:
514514
AUTOBUILD_JOB_NAME: samba-o3
515515
SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_ubuntu1804}
516516
SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE: "--enable-coverage"
517+
only:
518+
variables:
519+
# do not run o3 builds (which run a lot of VMs) if told not to
520+
# (this uses the same variable as autobuild.py)
521+
- $AUTOBUILD_SKIP_SAMBA_O3 == "0"
517522

518523
# All other jobs do not want code coverage.
519524
.samba-o3-template:
520525
extends: .shared_template
521526
variables:
522527
AUTOBUILD_JOB_NAME: samba-o3
523-
only:
524-
variables:
525-
# do not run o3 for coverage since they are using different images
526-
- $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE == ""
528+
rules:
529+
# do not run o3 builds (which run a lot of VMs) if told not to
530+
# (this uses the same variable as autobuild.py)
531+
- if: $AUTOBUILD_SKIP_SAMBA_O3 == "1"
532+
when: never
533+
# do not run o3 for coverage since they are using different images
534+
- if: $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE == ""
527535

528536
ubuntu2004-samba-o3:
529537
extends: .samba-o3-template

0 commit comments

Comments
 (0)