forked from GEOS-DEV/GEOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
194 lines (182 loc) · 8.23 KB
/
.travis.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
language: minimal
vm:
size: large
env:
global:
- GEOSX_TPL_TAG=194-777
- secure: CGs2uH6efq1Me6xJWRr0BnwtwxoujzlowC4FHXHdWbNOkPsXf7nCgdaW5vthfD3bhnOeEUQSrfxdhTRtyU/NfcKLmKgGBnZOdUG4/JJK4gDSJ2Wp8LZ/mB0QEoODKVxbh+YtoAiHe3y4M9PGCs+wkNDw/3eEU00cK12DZ6gad0RbLjI3xkhEr/ZEZDZkcYg9yHAhl5bmpqoh/6QGnIg8mxIqdAtGDw+6tT0EgUqjeqc5bG5WwsamKzJItHSXD5zx8IJAlgDk4EzEGjZe0m56YnNfb9iwqqUsmL3Cuwgs7ByVDYw78JC5Kv42YqoxA5BxMT2mFsEe37TpYNXlzofU7ma2Duw9DGXWQd4IkTCcBxlyR0I0bfo0TmgO+y7PYG9lIyHPUkENemdozsZcWamqqkqegiEdRhDVYlSRo3mu7iCwTS6ZTALliVyEYjYxYb7oAnR3cNywXjblTCI8oKfgLSY+8WijM9SRl57JruIHLkLMCjmRI+cZBfv5tS2tYQTBPkygGrigrrN77ZiC7/TGyfggSN0+y0oYtOAgqEnBcKcreiibMW7tKcV2Z1RFD9ZvIkSc1EXLUPDP8FX1oyhmqBMqVo8LksrYLDJHQ05+F3YNgl2taSt7uMjQ4e8iZ3/IjFeMnbylDw+cj/RbS520HXsFPbWFm2Pb9pceA9n6GnY=
# The integrated test repository contains large data (using git lfs) and we do not use them here.
# To save time (and money) we do not let travis automatically clone all our (lfs) subrepositories and do it by hand.
git:
submodules: false
services: docker
geosx_osx_build: &geosx_osx_build
os: osx
osx_image: xcode13.2
install:
- echo "running nproc"; nproc
- top -l 1 -s 0 | grep PhysMem
- TPL_METADATA_URL=https://www.googleapis.com/storage/v1/b/geosx/o/TPL%2Fosx-${GEOSX_TPL_TAG}.tar
- TPL_BULK_URL=${TPL_METADATA_URL}?alt=media
# Extracting the GEOSX_TPL installation directory
- METADATA=$(curl -s "${TPL_METADATA_URL}")
- GEOSX_TPL_DIR=$(echo -n ${METADATA} | python3 -c "import sys, json; print(json.load(sys.stdin)['metadata']['GEOSX_TPL_DIR'], end='')")
- sudo mkdir -p -m a=rwx ${GEOSX_TPL_DIR}
# Then download the TPLs and uncompress where needed
- curl -s "${TPL_BULK_URL}" | tar --strip-component=1 --directory=${GEOSX_TPL_DIR} -xf -
# Now let's deal with Homebrew third parties
- BREW_OPENMPI_VERSION=$(echo -n ${METADATA} | python3 -c "import sys, json; print(json.load(sys.stdin)['metadata']['BREW_OPENMPI_VERSION'], end='')")
- BREW_OPENMPI_TAP=${USER}/local-open-mpi
- brew tap-new ${BREW_OPENMPI_TAP}
- brew extract --version=${BREW_OPENMPI_VERSION} open-mpi ${BREW_OPENMPI_TAP}
- HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_MAKE_JOBS=$(nproc) brew install ${BREW_OPENMPI_TAP}/open-mpi@${BREW_OPENMPI_VERSION}
script:
- git submodule update --init --recursive src/cmake/blt
- git submodule update --init --recursive src/coreComponents/LvArray
- git submodule update --init --recursive src/coreComponents/constitutive/PVTPackage
- git submodule update --init src/coreComponents/mesh/PAMELA
- git submodule update --init --recursive src/coreComponents/fileIO/coupling/hdf5_interface
- python ${TRAVIS_BUILD_DIR}/scripts/config-build.py
-hc ${TRAVIS_BUILD_DIR}/host-configs/darwin-clang.cmake -bt Release
-DBLT_MPI_COMMAND_APPEND:STRING="--oversubscribe" -DENABLE_VTK:BOOL=OFF
- cd build-darwin-clang-release
- make -j $(nproc) VERBOSE=1
- ctest -V -E "testUncrustifyCheck|testDoxygenCheck|blt_mpi_smoke"
geosx_totalenergies_cluster_build: &geosx_totalenergies_cluster_build
script: scripts/ci_build_and_test.sh
# We use the most recent ubuntu distribution available in travis-ci to ensure maximum support of google cloud's sdk.
dist: bionic
addons:
apt:
sources:
- sourceline: 'deb https://packages.cloud.google.com/apt cloud-sdk main'
key_url: 'https://packages.cloud.google.com/apt/doc/apt-key.gpg'
packages:
- google-cloud-sdk
after_success:
# The temporary variable used at multiple locations.
- TMP_DIR=/tmp
# The variable `CONTAINER_NAME` is duplicated during the azure/travis migration. Consider modifying with care.
- CONTAINER_NAME=geosx_build
# We extract again the location of the GEOSX_TPL from the container. This is duplicated during the azure/travis migration.
- GEOSX_TPL_DIR=$(docker run --rm ${DOCKER_REPOSITORY}:${GEOSX_TPL_TAG} /bin/bash -c 'echo ${GEOSX_TPL_DIR}')
# Extracting both GEOSX and its TPL from the stopped container...
- GEOSX_EXPORT_DIR=GEOSX-and-TPL-${TRAVIS_COMMIT:0:7}
- docker cp -a ${CONTAINER_NAME}:${GEOSX_TPL_DIR}/.. ${TMP_DIR}/${GEOSX_EXPORT_DIR}
# ... and packing it.
- GEOSX_BUNDLE=${TMP_DIR}/${GEOSX_EXPORT_DIR}.tar.gz
- tar czf ${GEOSX_BUNDLE} --directory=${TMP_DIR} ${GEOSX_EXPORT_DIR}
# Uploading to GCP/GCS using gcloud CLI
- GEOSX_GCLOUD_KEY=/tmp/geosx-key.json
- openssl aes-256-cbc -K $encrypted_5ac030ea614b_key -iv $encrypted_5ac030ea614b_iv
-in ${TRAVIS_BUILD_DIR}/geosx-key.json.enc -out ${GEOSX_GCLOUD_KEY} -d
- gcloud auth activate-service-account --key-file=${GEOSX_GCLOUD_KEY}
- CLOUDSDK_PYTHON=python3 gsutil cp -a public-read ${GEOSX_BUNDLE} gs://${GCP_BUCKET}/
draft_script: &draft_script
script:
# TRAVIS_PULL_REQUEST is false if job is not from a PR
- if [[ $TRAVIS_PULL_REQUEST == false ]]; then exit 0; fi;
- |
is_draft=$(curl -H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST | \
jq ".draft")
# CI jobs will be cancelled if PR is a draft.
# PR status must be "Open" to run CI.
- |
if [[ $is_draft == true ]]; then
curl -sS -H "Travis-API-Version: 3" \
-H "Authorization: token $AUTH_VAR" \
-X POST https://api.travis-ci.com/build/$TRAVIS_BUILD_ID/cancel
exit 1
else
exit 0
fi
# PR must be assigned to be merged.
# This script will fail if this is not the case.
assigned_script: &assigned_script
script:
# TRAVIS_PULL_REQUEST is false if job is not from a PR
- if [[ $TRAVIS_PULL_REQUEST == false ]]; then exit 0; fi;
- |
is_assigned=$(curl -H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST | \
jq ".assignees|length")
- if [[ $is_assigned == 0 ]]; then exit 1; else exit 0; fi
return_script: &return_script
script:
# Verifies if all the "checks" jobs passed
- |
exit $(curl -sS -H "Travis-API-Version: 3" \
-X GET https://api.travis-ci.com/build/$TRAVIS_BUILD_ID/jobs | \
jq '[ .jobs[] | select( (.stage.name == "checks") and (.allow_failure == true) and (.state != "passed")) ] | length')
stages:
- checks
- builds
- return_status
jobs:
allow_failures:
- name: code_style
- name: documentation
- name: check_submodules
- name: check_pr_is_assigned
include:
- stage: checks
name: check_pr_is_not_a_draft
<<: *draft_script
- stage: checks
name: code_style
script: scripts/ci_build_and_test.sh
env:
- DOCKER_REPOSITORY=geosx/ubuntu20.04-gcc9
- CMAKE_BUILD_TYPE=Release
- BUILD_AND_TEST_ARGS=--test-code-style
- stage: checks
name: documentation
script: scripts/ci_build_and_test.sh
env:
- DOCKER_REPOSITORY=geosx/ubuntu20.04-gcc9
- CMAKE_BUILD_TYPE=Release
- BUILD_AND_TEST_ARGS=--test-documentation
- stage: checks
name: check_submodules
script: scripts/test_submodule_updated.sh
- stage: checks
name: check_pr_is_assigned
<<: *assigned_script
- stage: builds
name: Pecan GPU (centos 7.7, gcc 8.2.0, open-mpi 4.0.1, mkl 2019.5, cuda 10.2.89p2)
<<: *geosx_totalenergies_cluster_build
env:
- DOCKER_REPOSITORY=geosx/pecan-gpu-gcc8.2.0-openmpi4.0.1-mkl2019.5-cuda10.2.89p2
- CMAKE_BUILD_TYPE=Release
- BUILD_AND_TEST_ARGS=--disable-unit-tests
- HOST_CONFIG=host-configs/TOTAL/pecan-GPU.cmake
- GCP_BUCKET=geosx/Pecan-GPU
- stage: builds
name: Pecan CPU (centos 7.7, gcc 8.2.0, open-mpi 4.0.1, mkl 2019.5)
<<: *geosx_totalenergies_cluster_build
env:
- DOCKER_REPOSITORY=geosx/pecan-cpu-gcc8.2.0-openmpi4.0.1-mkl2019.5
- CMAKE_BUILD_TYPE=Release
- HOST_CONFIG=host-configs/TOTAL/pecan-CPU.cmake
- GCP_BUCKET=geosx/Pecan-CPU
- stage: builds
name: Pangea 2 (centos 7.6, gcc 8.3.0, open-mpi 2.1.5, mkl 2019.3)
<<: *geosx_totalenergies_cluster_build
env:
- DOCKER_REPOSITORY=geosx/pangea2-gcc8.3.0-openmpi2.1.5-mkl2019.3
- CMAKE_BUILD_TYPE=Release
- GCP_BUCKET=geosx/Pangea2
- ENABLE_HYPRE=ON
- ENABLE_TRILINOS=OFF
- stage: builds
name: Mac_OSX
<<: *geosx_osx_build
- stage: builds
name: Ubuntu debug (20.04, gcc 10.3.0, open-mpi 4.0.3)
script: scripts/ci_build_and_test.sh
env:
- DOCKER_REPOSITORY=geosx/ubuntu20.04-gcc10
- CMAKE_BUILD_TYPE=Debug
- stage: return_status
<<: *return_script