@@ -21,8 +21,16 @@ timeout_in: 10m
21
21
# clone with our own commands too.
22
22
clone_template : &HTSLIB_CLONE
23
23
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'`
26
34
27
35
# --------------------------------------------------
28
36
# Template: bcftools compile and test
@@ -34,16 +42,34 @@ compile_template: &COMPILE
34
42
if test "$USE_CONFIG" = "yes"; then
35
43
(cd $HTSDIR && autoreconf -i)
36
44
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)
38
51
make -j3
39
52
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"}
41
59
fi
42
60
43
61
test_template : &TEST
44
62
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
47
73
48
74
# --------------------------------------------------
49
75
# Task: linux builds.
@@ -60,15 +86,23 @@ gcc_task:
60
86
LC_ALL : C
61
87
CIRRUS_CLONE_DEPTH : 1
62
88
HTSDIR : ./htslib
63
- CFLAGS : -fsanitize=address
64
- LDFLAGS : -fsanitize=address
65
89
66
90
matrix :
67
91
- environment :
68
92
USE_CONFIG : no
93
+ CFLAGS : -g -Og -Wall -Werror -fsanitize=address
94
+ LDFLAGS : -fsanitize=address
69
95
- environment :
70
96
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
+
72
106
73
107
<< : *COMPILE
74
108
<< : *TEST
@@ -84,18 +118,19 @@ ubuntu_task:
84
118
85
119
environment :
86
120
CC : clang
87
- CFLAGS : -g -O2 -Werror -Wall -Wformat -Wformat=2
88
121
LC_ALL : C
89
122
CIRRUS_CLONE_DEPTH : 1
90
123
HTSDIR : ./htslib
91
124
92
125
matrix :
93
126
- environment :
94
127
USE_CONFIG : no
128
+ CFLAGS : -g -O2 -Werror -Wall -Wformat -Wformat=2
95
129
- container :
96
130
memory : 2G
97
131
environment :
98
132
USE_CONFIG : yes
133
+ CONFIG_OPTS : --enable-libgsl --enable-perl-filters
99
134
CFLAGS : -g -Wall -O3
100
135
LDFLAGS : -Wl,-rpath,`pwd`/inst/lib
101
136
@@ -106,7 +141,7 @@ ubuntu_task:
106
141
apt-get install -y --no-install-suggests --no-install-recommends \
107
142
ca-certificates clang git autoconf automake \
108
143
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
110
145
111
146
<< : *COMPILE
112
147
<< : *TEST
@@ -125,13 +160,14 @@ rockylinux_task:
125
160
CIRRUS_CLONE_DEPTH : 1
126
161
HTSDIR : ./htslib
127
162
USE_CONFIG : yes
163
+ CONFIG_OPTS : --enable-libgsl --enable-perl-filters
128
164
129
165
# NB: we could consider building a docker image with these
130
166
# preinstalled and specifying that instead, to speed up testing.
131
167
install_script : |
132
168
yum install -y autoconf automake make gcc perl-Data-Dumper perl-FindBin \
133
169
zlib-devel bzip2 bzip2-devel xz-devel curl-devel openssl-devel \
134
- git diffutils
170
+ git diffutils gsl-devel perl-ExtUtils-Embed
135
171
136
172
<< : *COMPILE
137
173
<< : *TEST
@@ -143,7 +179,7 @@ rockylinux_task:
143
179
macosx_task :
144
180
name : macosx + clang
145
181
macos_instance :
146
- image : ghcr.io/cirruslabs/macos-ventura-base:latest
182
+ image : ghcr.io/cirruslabs/macos-runner:sonoma
147
183
148
184
environment :
149
185
CC : clang
0 commit comments