-
Notifications
You must be signed in to change notification settings - Fork 240
/
.cirrus.yml
200 lines (167 loc) · 5.57 KB
/
.cirrus.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# Note we have a maximum of 16 CPUs available, so adjust our
# builds so we can start all concurrently without needing to schedule.
# Sadly though there is still a finite limit to macOS of one instance.
# Can we cull our Mac test to just one instance?
timeout_in: 10m
#--------------------------------------------------
# Template: htslib clone & build
#
# We try to clone htslib using the same branch name and owner as this
# bcftools branch. If it exists, it's likely the user is making a
# joint bcftools+htslib PR and wants both checked in unison.
# Failing that we use samtools/htslib:develop.
# Note this only works on the users own forks. Once in the samtools
# organisation the branch name becomes pull/<num>.
# Logic for choosing which to use is in the .ci_helpers/clone script.
# Note we could also use "clone_script" if we want to replace the bcftools
# clone with our own commands too.
clone_template: &HTSLIB_CLONE
htslib_clone_script: |
# Tricky, but when run as a PR Cirrus-CI obscures the branch name and
# replaces it by pull/<num>. This means we can't automatically get PRs
# to test whether the user has a similarly named branch to compiler and
# test against.
#
# Instead if we add htslib#NUM into the first line of the commit then
# we will use that PR from htslib instead. This is only needed when
# making a PR, so for development prior to the PR being made the
# CIRRUS_BRANCH will be used in preference.
.ci_helpers/clone ${CIRRUS_REPO_OWNER} htslib "${HTSDIR}" "${CIRRUS_BRANCH}" `printenv CIRRUS_CHANGE_TITLE | sed -n 's/.*htslib#\([0-9]*\).*/\1/p'`
#--------------------------------------------------
# Template: bcftools compile and test
compile_template: &COMPILE
<< : *HTSLIB_CLONE
compile_script: |
if test "$USE_CONFIG" = "yes"; then
(cd $HTSDIR && autoreconf -i)
autoreconf -i
./configure --enable-werror $CONFIG_OPTS \
${CC:+CC="$CC"} \
${CFLAGS:+CFLAGS="$CFLAGS"} \
${CPPFLAGS:+CPPFLAGS="$CPPFLAGS"} \
${LDFLAGS:+LDFLAGS="$LDFLAGS"} \
|| (cat config.log; /bin/false)
make -j3
else
make -j3 plugindir="$CIRRUS_WORKING_DIR/plugins" \
${HTSDIR:+HTSDIR="$HTSDIR"} \
${CC:+CC="$CC"} \
${CFLAGS:+CFLAGS="$CFLAGS"} \
${CPPFLAGS:+CPPFLAGS="$CPPFLAGS"} \
${LDFLAGS:+LDFLAGS="$LDFLAGS"}
fi
test_template: &TEST
test_script: |
if test "$USE_CONFIG" = "yes"; then
make test
else
make test \
${HTSDIR:+HTSDIR="$HTSDIR"} \
${CC:+CC="$CC"} \
${CFLAGS:+CFLAGS="$CFLAGS"} \
${CPPFLAGS:+CPPFLAGS="$CPPFLAGS"} \
${LDFLAGS:+LDFLAGS="$LDFLAGS"}
fi
#--------------------------------------------------
# Task: linux builds.
# Debian + latest GCC
gcc_task:
name: debian-gcc
container:
image: gcc:latest
cpu: 1
memory: 1G
environment:
LC_ALL: C
CIRRUS_CLONE_DEPTH: 1
HTSDIR: ./htslib
matrix:
- environment:
USE_CONFIG: no
CFLAGS: -g -Og -Wall -Werror -fsanitize=address
LDFLAGS: -fsanitize=address
- environment:
USE_CONFIG: yes
CONFIG_OPTS: --enable-libgsl --enable-perl-filters
CFLAGS: -std=gnu99 -g -Og -Wall -fsanitize=address
LDFLAGS: -fsanitize=address
install_script: |
apt-get update
apt-get install -y --no-install-suggests --no-install-recommends \
libdeflate-dev libperl-dev libgsl0-dev libio-pty-perl
<< : *COMPILE
<< : *TEST
# Ubuntu + Clang
ubuntu_task:
name: ubuntu-clang
container:
image: ubuntu:latest
cpu: 2
memory: 1G
environment:
CC: clang
LC_ALL: C
CIRRUS_CLONE_DEPTH: 1
HTSDIR: ./htslib
matrix:
- environment:
USE_CONFIG: no
CFLAGS: -g -O2 -Werror -Wall -Wformat -Wformat=2
- container:
memory: 2G
environment:
USE_CONFIG: yes
CONFIG_OPTS: --enable-libgsl --enable-perl-filters
CFLAGS: -g -Wall -O3
LDFLAGS: -Wl,-rpath,`pwd`/inst/lib
# NB: we could consider building a docker image with these
# preinstalled and specifying that instead, to speed up testing.
install_script: |
apt-get update
apt-get install -y --no-install-suggests --no-install-recommends \
ca-certificates clang git autoconf automake \
make zlib1g-dev libbz2-dev liblzma-dev libcurl4-gnutls-dev \
libssl-dev libdeflate-dev libperl-dev libgsl0-dev libio-pty-perl
<< : *COMPILE
<< : *TEST
# Rocky Linux
rockylinux_task:
name: rockylinux-gcc
container:
image: rockylinux:9
cpu: 2
memory: 1G
environment:
LC_ALL: C
CIRRUS_CLONE_DEPTH: 1
HTSDIR: ./htslib
USE_CONFIG: yes
CONFIG_OPTS: --enable-libgsl --enable-perl-filters
# NB: we could consider building a docker image with these
# preinstalled and specifying that instead, to speed up testing.
install_script: |
yum install -y autoconf automake make gcc perl-Data-Dumper perl-FindBin \
zlib-devel bzip2 bzip2-devel xz-devel curl-devel openssl-devel \
git diffutils gsl-devel perl-ExtUtils-Embed
<< : *COMPILE
<< : *TEST
#--------------------------------------------------
# Task: macOS builds
macosx_task:
name: macosx + clang
macos_instance:
image: ghcr.io/cirruslabs/macos-runner:sonoma
environment:
CC: clang
LC_ALL: C
CIRRUS_CLONE_DEPTH: 1
HTSDIR: ./htslib
matrix:
- environment:
USE_CONFIG: no
- environment:
USE_CONFIG: yes
package_install_script:
- HOMEBREW_NO_AUTO_UPDATE=1 brew install autoconf automake libtool xz
<< : *COMPILE
<< : *TEST