-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy path.travis.yml
More file actions
264 lines (239 loc) · 10.7 KB
/
.travis.yml
File metadata and controls
264 lines (239 loc) · 10.7 KB
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
#
# The libdap build
#
# Initial Travis-CI control file. 6.5.15 jhrg
# Updated many times... finally using docker (containers). 7.14.15 jhrg
#
# Modified to push the result of a successful build to an AWS S3
# bucket. jhrg 2.24.18
# virt: lxd # use a lxd container
# arch: amd64 # optional, this is the default, routes to a full VM
# os: linux # optional, this is the default
dist: focal # xenial (Ubuntu 16) is the default; focal is Ubuntu 20
vm:
size: x-large
language: cpp
compiler: gcc # Could add clang
# Build only 'master,' 'main,' or '.*-test-deploy' branches. This is used down in the
# "stages" section where we assume the build process is only run for branches that
# match those patterns. jhrg 8/22/22
# Added '.*-test-scan' to the list of branches that can trigger a build. jhrg 1/18/24
branches:
only:
- master
- main
- /^(.*-test-deploy)$/
- /^(.*-test-scan)$/ # enables running only the scan. jhrg 1/18/24
# This cache is used to speed up sonar scan runs. See https://docs.travis-ci.com/user/caching.
# Each branch gets its own cache. jhrg 2/11/22
cache:
ccache: true
pip: true
apt: true
directories:
- ./.cache/sonar/
addons:
sonarcloud:
organization: "opendap"
apt:
packages:
- libxml2-dev
- uuid-dev
- libcurl4-openssl-dev
- libcppunit-dev
- gcovr
- libfl-dev # needed for focal, but not xenial. jhrg 1/18/24
- libtool-bin
- ccache
env:
global:
# NB: This value of $prefix must be shared between the hyrax-deps, libdap and bes builds.
# The three env vars below simulate running 'source spath.sh' in the 'hyrax' repo main directory.
# $HOME is /home/travis
- prefix=$HOME/install
- PATH=$prefix/bin:$PATH
- BUILD_PROCS=$(nproc)
- TESTSUITEFLAGS=-j$BUILD_PROCS
- CCACHE_DIR=$HOME/.ccache
- CCACHE_BASEDIR=$TRAVIS_BUILD_DIR
- CCACHE_MAXSIZE=10G
- CCACHE_COMPRESS=true
# Added to reduce cache misses due to config.h rebuilds. jhrg 4/2/26
- CCACHE_SLOPPINESS=include_file_mtime,time_macros
# GIT_UID travis-ci-opendap
- secure: "g+SL53aSnULaToAu+HJO86Ljr6//j+aVSlVh7ROj6h80PDVmSW0xyiLUQRkA24vMrQqNY/rj6+qAXgVGORCPs2JBGcKjELzLr30eNDXfUNOjB+0actXI8sKD8I3eTZMHawOpedtk9v884Z+iQJauh04tD70sUMBp/WpCp+mXgQE="
# GIT_PSWD travis-ci-opendap
- secure: "Oi3LunWs6lnFSW83d8z1llVBGIfUx3E+0d6wRAnkO0Q3muTMr8zm/bmaBt7XxnUQ3uKjRp9Uwkqtt7jJDHfTMeO5mXqYz018mc+PxwPmfFk6mnCQVbu1fk2tDRFbKYBPxILk0lvkShqzfKJJ9g/5b1IBJ/oxZAErf21qMqi1IHU="
# only install things when needed to save time. jhrg 4/1/26
before_install:
- if test -n "$AWS_ACCESS_KEY_ID" -a \( "$TRAVIS_JOB_NAME" = "make" -o "$TRAVIS_JOB_NAME" = "asan" -o "$TRAVIS_JOB_NAME" = "distcheck" \); then pip install --user awscli; fi
# fix for Java 17 install for Sonar from Travis CI support. jhrg 1/23/24
- if test "$TRAVIS_JOB_NAME" = "scan"; then curl -s "https://get.sdkman.io" | bash; fi
- if test "$TRAVIS_JOB_NAME" = "scan"; then source "$HOME/.sdkman/bin/sdkman-init.sh"; fi
- if test "$TRAVIS_JOB_NAME" = "scan"; then sdk install java 17.0.2-open; fi
- if test "$TRAVIS_JOB_NAME" = "scan"; then sdk use java 17.0.2-open; fi
- if test "$TRAVIS_JOB_NAME" = "scan"; then java -version; fi
install:
- which bison flex
- bison --version
- flex --version
- autoconf --version
- automake --version
- libtool --version
before_script:
- source travis/travis_libdap_build_offset.sh
- export LIBDAP_BUILD_NUMBER=$(expr $TRAVIS_BUILD_NUMBER - $LIBDAP_TRAVIS_BUILD_OFFSET)
- echo "LIBDAP_BUILD_NUMBER is ${LIBDAP_BUILD_NUMBER} = ${TRAVIS_BUILD_NUMBER} - ${LIBDAP_TRAVIS_BUILD_OFFSET}"
- ccache --zero-stats || true
- ccache --max-size "$CCACHE_MAXSIZE" || true
stages:
- name: build
if: branch = master OR branch = main OR branch =~ ^(.*-test-deploy)$
- name: scan
if: branch = master OR branch = main OR branch =~ ^(.*-test-scan)$
- name: package
if: branch = master OR branch = main OR branch =~ ^(.*-test-deploy)$
- name: hyrax-bes-trigger
# This stage is used to trigger a build of the Hyrax BES. It is triggered by a successful
# build but only for things that are not pull requests with the sole exception that branches
# that end in '-test-deploy' are also allowed to trigger a BES build. jhrg 1/18/24
if: type != pull_request AND NOT branch =~ ^(.*-test-scan)$ OR branch =~ ^(.*-test-deploy)$
jobs:
include:
- stage: build
name: "make"
env: CACHE_NAME=make
script:
- export LIBDAP_BUILD=main
- autoreconf --force --install --verbose
- ./configure --disable-dependency-tracking --prefix=$prefix
- make -j$BUILD_PROCS && make check -j$BUILD_PROCS && make install
- stage: build
name: "asan"
env: CACHE_NAME=asan
script:
- export LIBDAP_BUILD=asan
- autoreconf --force --install --verbose
- ./configure --disable-dependency-tracking --prefix=$prefix --enable-developer --enable-asan
- make -j$BUILD_PROCS && make check -j$BUILD_PROCS
- stage: build
name: "distcheck"
env: CACHE_NAME=distcheck
script:
- export LIBDAP_BUILD=distcheck
- autoreconf --force --install --verbose
- ./configure --disable-dependency-tracking --prefix=$prefix
- make distcheck -j$BUILD_PROCS
- stage: scan
name: "scan"
env: CACHE_NAME=scan
script:
- export LIBDAP_BUILD=sonar
- export SONAR_TOKEN=$SONAR_LOGIN
- autoreconf --force --install --verbose
- ./configure --disable-dependency-tracking --prefix=$prefix --enable-developer --enable-coverage
- build-wrapper-linux-x86-64 --out-dir bw-output make -j$BUILD_PROCS
- make check -j$BUILD_PROCS
- gcovr --config gcovr.config --sonarqube coverage.xml
- sonar-scanner
# The scanner waits for the quality gate because sonar.qualitygate.wait=true is set
# in sonar-project.properties, so no extra badge/API polling is needed here.
- stage: package
name: "rocky8 RPMs"
script:
- export LIBDAP_BUILD=rocky8
# $prefix = $HOME/install which is /home/travis/install here but should be /root/install in the image.
- mkdir -p $prefix/rpmbuild
- docker run --env prefix=/root/install --volume $prefix/rpmbuild:/root/rpmbuild
--volume $TRAVIS_BUILD_DIR:/root/travis --env AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
--env AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY --env os=rocky8
--env LIBDAP_BUILD_NUMBER=$LIBDAP_BUILD_NUMBER opendap/rocky8_hyrax_builder:latest
/root/travis/travis/build-rh8-rpm.sh
- stage: package
name: "rocky9 RPMs"
script:
- export LIBDAP_BUILD=rocky9
# $prefix = $HOME/install which is /home/travis/install here but should be /root/install in the image.
- mkdir -p $prefix/rpmbuild
- docker run
--env prefix=/root/install
--volume $prefix/rpmbuild:/root/rpmbuild
--volume $TRAVIS_BUILD_DIR:/root/libdap4
--env LIBDAP_BUILD_NUMBER=$LIBDAP_BUILD_NUMBER
opendap/rocky9_hyrax_builder:latest
/root/libdap4/travis/build-rh9-rpm.sh
- stage: package
name: "source distribution"
env: CACHE_NAME=srcdist
# Use a workspace to pass the source distribution tarball and version file to the next
# stage that triggers the BES build. jhrg 4/1/26
workspaces:
create:
name: snapshot-release
paths:
- .travis-workspace/snapshot
script:
- export LIBDAP_BUILD=srcdist
- mkdir -p $TRAVIS_BUILD_DIR/package
- mkdir -p $TRAVIS_BUILD_DIR/.travis-workspace/snapshot
- autoreconf --force --install --verbose
- ./configure --disable-dependency-tracking --prefix=$prefix --with-build=$LIBDAP_BUILD_NUMBER
- make dist -j$BUILD_PROCS
# Make both a libdap-<version>-<build num> and libdap-snapshot tar.gz. This will simplify
# other operations that use the libdap source code like the bes build. Note that the VERSION
# file holds a string that is the version number as set by the configure script and the build
# number passed into configure when it is run. jhrg 3/23/21
- SOURCE_VERSION=$(cat libdap_VERSION)
- mv libdap-*.tar.gz libdap-$SOURCE_VERSION.tar.gz
- cp libdap-$SOURCE_VERSION.tar.gz libdap-snapshot.tar.gz
- cp libdap_VERSION $TRAVIS_BUILD_DIR/.travis-workspace/snapshot/
- cp libdap-$SOURCE_VERSION.tar.gz $TRAVIS_BUILD_DIR/.travis-workspace/snapshot/
- cp libdap-snapshot.tar.gz $TRAVIS_BUILD_DIR/.travis-workspace/snapshot/
- stage: hyrax-bes-trigger
name: "Hyrax BES Trigger"
env: CACHE_NAME=hyrax-bes-trigger
workspaces:
use: snapshot-release
script:
- export STAGE=hyrax-bes
- echo $STAGE
- cp .travis-workspace/snapshot/libdap_VERSION ./libdap_VERSION
- ./travis/trigger-bes-build.sh
after_script:
- ccache --show-stats || true
- ./travis/upload-test-results.sh
before_deploy:
# This part of the before_deploy action copies the built distributions named with version numbers
# into $TRAVIS_BUILD_DIR/package and then places a second copy of those files with the version
# number replaced with the word 'snapshot.' These files are used for the our snapshot delivery
# and deployment process. jhrg 10/28/19
# Also, when $LIBDAP_BUILD is 'main' a 'binary build' is captured in a tar ball and used for the
# downstream BES build to save having to compile libdap there. jhrg 3/22/21
- echo "LIBDAP_BUILD ${LIBDAP_BUILD}"
- export DEPLOY="S3"
- mkdir -p $TRAVIS_BUILD_DIR/package
# Build the binary used by downstream Travis BES builds
- if test "$LIBDAP_BUILD" = "main"; then tar -C $HOME -czvf $TRAVIS_BUILD_DIR/package/libdap-build.tar.gz
--exclude 'install/deps*' --exclude 'install/rpmbuild*' install; fi
# rocky8 distribution prep
- if test "$LIBDAP_BUILD" = "rocky8"; then ./travis/rpm-to-package-dir.sh "el8"; fi
# rocky9 distribution prep
- if test "$LIBDAP_BUILD" = "rocky9"; then ./travis/rpm-to-package-dir.sh "el9"; fi
# Src dist distribution prep
- if test "$LIBDAP_BUILD" = "srcdist"; then cp libdap-*.tar.gz $TRAVIS_BUILD_DIR/package; fi
# Check for the stuff...
- ls -lR $TRAVIS_BUILD_DIR/package
deploy:
provider: s3
edge: true
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
bucket: opendap.travis.build
skip_cleanup: true
local_dir: $TRAVIS_BUILD_DIR/package
on:
all_branches: true
# Was "branch: master". Now supports the *-test-deploy feature and also
# using 'main' as the branch name. jhrg 8/22/22
condition: $LIBDAP_BUILD =~ ^(main|srcdist|rocky8|rocky9)$
# Added 'rocky9|' ndp 11/19/25