]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add FreeBSD to GitLab CI
authorMichał Kępień <michal@isc.org>
Thu, 12 Sep 2019 12:25:57 +0000 (14:25 +0200)
committerMichał Kępień <michal@isc.org>
Thu, 12 Sep 2019 13:00:38 +0000 (15:00 +0200)
Ensure BIND can be tested on FreeBSD in GitLab to more quickly catch
build and test errors on that operating system.  Make the relevant jobs
optional until the CI environment supporting them is deemed stable
enough for continuous use.

FreeBSD jobs are run using the Custom executor feature of GitLab Runner.
Unlike the Docker executor, the Custom executor does not support the
"image" option and thus some way of informing the runner about the OS
version to use for a given job is necessary.  Arguably the simplest way
of doing that without a lot of code duplication in .gitlab-ci.yml would
be to use a YAML template with a "variables" block specifying the
desired FreeBSD release to use, but including such a template in a job
definition would cause issues in case other variables also needed to be
set for that job (e.g. CFLAGS or EXTRA_CONFIGURE for build jobs).  Thus,
only one FreeBSD YAML template is defined instead and the Custom
executor scripts on FreeBSD runners extract the OS version to use from
the CI job name.  This allows .gitlab-ci.yml variables to be defined for
FreeBSD jobs in the same way as for Docker-based jobs.

(cherry picked from commit 51af91d0073e773259ec19b61daf9bca40ef79a9)

.gitlab-ci.yml

index f63afa504d668aa2d62689189dfb822e837d5eb7..e7415bafc43029a615e135d4214c7b90d508034d 100644 (file)
@@ -11,6 +11,7 @@ variables:
   # VirtualBox driver needs to set build_dir to "/builds" in gitlab-runner.toml
   KYUA_RESULT: "$CI_PROJECT_DIR/kyua.results"
 
+  GIT_DEPTH: 1
   BUILD_PARALLEL_JOBS: 6
   TEST_PARALLEL_JOBS: 6
 
@@ -24,6 +25,13 @@ stages:
 
 ### Runner Tag Templates
 
+# Note: FreeBSD runners extract the FreeBSD version to use from job name
+
+.freebsd-amd64: &freebsd_amd64
+  tags:
+    - freebsd
+    - amd64
+
 .linux-amd64: &linux_amd64
   tags:
     - linux
@@ -616,6 +624,57 @@ unit:pkcs11:sid:amd64:
     - pkcs11:sid:amd64
   needs: ["pkcs11:sid:amd64"]
 
+# Jobs for Clang builds on FreeBSD 11.3 (amd64)
+
+clang:freebsd11.3:amd64:
+  variables:
+    CFLAGS: "-Wall -Wextra -O2 -g"
+  <<: *freebsd_amd64
+  <<: *build_job
+  when: manual
+
+system:clang:freebsd11.3:amd64:
+  <<: *freebsd_amd64
+  <<: *system_test_job
+  dependencies:
+    - clang:freebsd11.3:amd64
+  needs: ["clang:freebsd11.3:amd64"]
+  when: manual
+
+unit:clang:freebsd11.3:amd64:
+  <<: *freebsd_amd64
+  <<: *unit_test_job
+  dependencies:
+    - clang:freebsd11.3:amd64
+  needs: ["clang:freebsd11.3:amd64"]
+  when: manual
+
+# Jobs for Clang builds on FreeBSD 12.0 (amd64)
+
+clang:freebsd12.0:amd64:
+  variables:
+    CFLAGS: "-Wall -Wextra -O2 -g"
+    EXTRA_CONFIGURE: "--enable-dnstap"
+  <<: *freebsd_amd64
+  <<: *build_job
+  when: manual
+
+system:clang:freebsd12.0:amd64:
+  <<: *freebsd_amd64
+  <<: *system_test_job
+  dependencies:
+    - clang:freebsd12.0:amd64
+  needs: ["clang:freebsd12.0:amd64"]
+  when: manual
+
+unit:clang:freebsd12.0:amd64:
+  <<: *freebsd_amd64
+  <<: *unit_test_job
+  dependencies:
+    - clang:freebsd12.0:amd64
+  needs: ["clang:freebsd12.0:amd64"]
+  when: manual
+
 # Jobs with libtool disabled
 
 nolibtool:sid:amd64: