2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Add FreeBSD to GitLab CI

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.
This commit is contained in:
Michał Kępień
2019-09-12 14:25:57 +02:00
parent 154f2ca6f6
commit 51af91d007

View 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
@@ -661,6 +669,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: