@@ -21,8 +21,16 @@ timeout_in: 10m
2121# clone with our own commands too.
2222clone_template : &HTSLIB_CLONE
2323 htslib_clone_script : |
24- .ci_helpers/clone "https://github.com/${CIRRUS_REPO_OWNER}/htslib" "${HTSDIR}" "${CIRRUS_BRANCH}"
25-
24+ # Tricky, but when run as a PR Cirrus-CI obscures the branch name and
25+ # replaces it by pull/<num>. This means we can't automatically get PRs
26+ # to test whether the user has a similarly named branch to compiler and
27+ # test against.
28+ #
29+ # Instead if we add htslib#NUM into the first line of the commit then
30+ # we will use that PR from htslib instead. This is only needed when
31+ # making a PR, so for development prior to the PR being made the
32+ # CIRRUS_BRANCH will be used in preference.
33+ .ci_helpers/clone ${CIRRUS_REPO_OWNER} htslib "${HTSDIR}" "${CIRRUS_BRANCH}" `printenv CIRRUS_CHANGE_TITLE | sed -n 's/.*htslib#\([0-9]*\).*/\1/p'`
2634
2735# --------------------------------------------------
2836# Template: bcftools compile and test
@@ -34,16 +42,34 @@ compile_template: &COMPILE
3442 if test "$USE_CONFIG" = "yes"; then
3543 (cd $HTSDIR && autoreconf -i)
3644 autoreconf -i
37- ./configure --enable-werror || (cat config.log; /bin/false)
45+ ./configure --enable-werror $CONFIG_OPTS \
46+ ${CC:+CC="$CC"} \
47+ ${CFLAGS:+CFLAGS="$CFLAGS"} \
48+ ${CPPFLAGS:+CPPFLAGS="$CPPFLAGS"} \
49+ ${LDFLAGS:+LDFLAGS="$LDFLAGS"} \
50+ || (cat config.log; /bin/false)
3851 make -j3
3952 else
40- make -j3 plugindir=$CIRRUS_WORKING_DIR/plugins -e
53+ make -j3 plugindir="$CIRRUS_WORKING_DIR/plugins" \
54+ ${HTSDIR:+HTSDIR="$HTSDIR"} \
55+ ${CC:+CC="$CC"} \
56+ ${CFLAGS:+CFLAGS="$CFLAGS"} \
57+ ${CPPFLAGS:+CPPFLAGS="$CPPFLAGS"} \
58+ ${LDFLAGS:+LDFLAGS="$LDFLAGS"}
4159 fi
4260
4361test_template : &TEST
4462 test_script : |
45- make -e test
46-
63+ if test "$USE_CONFIG" = "yes"; then
64+ make test
65+ else
66+ make test \
67+ ${HTSDIR:+HTSDIR="$HTSDIR"} \
68+ ${CC:+CC="$CC"} \
69+ ${CFLAGS:+CFLAGS="$CFLAGS"} \
70+ ${CPPFLAGS:+CPPFLAGS="$CPPFLAGS"} \
71+ ${LDFLAGS:+LDFLAGS="$LDFLAGS"}
72+ fi
4773
4874# --------------------------------------------------
4975# Task: linux builds.
@@ -60,15 +86,23 @@ gcc_task:
6086 LC_ALL : C
6187 CIRRUS_CLONE_DEPTH : 1
6288 HTSDIR : ./htslib
63- CFLAGS : -fsanitize=address
64- LDFLAGS : -fsanitize=address
6589
6690 matrix :
6791 - environment :
6892 USE_CONFIG : no
93+ CFLAGS : -g -Og -Wall -Werror -fsanitize=address
94+ LDFLAGS : -fsanitize=address
6995 - environment :
7096 USE_CONFIG : yes
71- CFLAGS : -std=gnu99 -O0
97+ CONFIG_OPTS : --enable-libgsl --enable-perl-filters
98+ CFLAGS : -std=gnu99 -g -Og -Wall -fsanitize=address
99+ LDFLAGS : -fsanitize=address
100+
101+ install_script : |
102+ apt-get update
103+ apt-get install -y --no-install-suggests --no-install-recommends \
104+ libdeflate-dev libperl-dev libgsl0-dev libio-pty-perl
105+
72106
73107 << : *COMPILE
74108 << : *TEST
@@ -84,18 +118,19 @@ ubuntu_task:
84118
85119 environment :
86120 CC : clang
87- CFLAGS : -g -O2 -Werror -Wall -Wformat -Wformat=2
88121 LC_ALL : C
89122 CIRRUS_CLONE_DEPTH : 1
90123 HTSDIR : ./htslib
91124
92125 matrix :
93126 - environment :
94127 USE_CONFIG : no
128+ CFLAGS : -g -O2 -Werror -Wall -Wformat -Wformat=2
95129 - container :
96130 memory : 2G
97131 environment :
98132 USE_CONFIG : yes
133+ CONFIG_OPTS : --enable-libgsl --enable-perl-filters
99134 CFLAGS : -g -Wall -O3
100135 LDFLAGS : -Wl,-rpath,`pwd`/inst/lib
101136
@@ -106,7 +141,7 @@ ubuntu_task:
106141 apt-get install -y --no-install-suggests --no-install-recommends \
107142 ca-certificates clang git autoconf automake \
108143 make zlib1g-dev libbz2-dev liblzma-dev libcurl4-gnutls-dev \
109- libssl-dev libdeflate-dev
144+ libssl-dev libdeflate-dev libperl-dev libgsl0-dev libio-pty-perl
110145
111146 << : *COMPILE
112147 << : *TEST
@@ -125,13 +160,14 @@ rockylinux_task:
125160 CIRRUS_CLONE_DEPTH : 1
126161 HTSDIR : ./htslib
127162 USE_CONFIG : yes
163+ CONFIG_OPTS : --enable-libgsl --enable-perl-filters
128164
129165 # NB: we could consider building a docker image with these
130166 # preinstalled and specifying that instead, to speed up testing.
131167 install_script : |
132168 yum install -y autoconf automake make gcc perl-Data-Dumper perl-FindBin \
133169 zlib-devel bzip2 bzip2-devel xz-devel curl-devel openssl-devel \
134- git diffutils
170+ git diffutils gsl-devel perl-ExtUtils-Embed
135171
136172 << : *COMPILE
137173 << : *TEST
@@ -143,7 +179,7 @@ rockylinux_task:
143179macosx_task :
144180 name : macosx + clang
145181 macos_instance :
146- image : ghcr.io/cirruslabs/macos-ventura-base:latest
182+ image : ghcr.io/cirruslabs/macos-runner:sonoma
147183
148184 environment :
149185 CC : clang
0 commit comments