forked from lanl/LaGriT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
80 lines (70 loc) · 2.28 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
language: c
sudo: required
os:
- linux
- osx
compiler:
- gcc
branches:
only:
- master
# Install dependencies for various OS'
before_install:
- if [ $TRAVIS_OS_NAME = windows ]; then choco install make cmake; fi
- if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get purge cmake && sudo apt-key update && sudo apt-get update && sudo apt-get -y -f install gfortran libz-dev m4 bison python3 cmake; fi
- if [ $TRAVIS_OS_NAME = osx ]; then brew update && brew install gcc; fi
- export FC=$(which gfortran); echo $FC
- export CC=$(which gcc); echo $CC
- export CXX=$(which g++); echo $CXX
install:
############################################################################
# Install a recent CMake
############################################################################
- DEPS_DIR="${HOME}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
# Exodus requires CMAKE 1.10.X+, which apt-get doesn't serve
# Manually build
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="https://cmake.org/files/v3.10/cmake-3.10.0-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
else
brew install cmake || brew upgrade cmake
fi
- cd -
- cmake --version
# Build Exodus and binary; test
script:
# LaGriT compilation tests
- make exodus CC=$CC FC=$FC CXX=$CXX
- make release CC=$CC FC=$FC CXX=$CXX
- make test
- make static CC=$CC FC=$FC CXX=$CXX
- make test
# Display successful messages
after_success:
- echo LaGriT successfully compiled
- cp src/lagrit lagrit-$TRAVIS_OS_NAME
# Push binaries to GitHub Releases *only* when there is a tagged commit
#jobs:
# include:
# - stage: Deploy macOS binary
# os: osx
# deploy:
# provider: releases
# api_key: $GITHUB_OATH_TOKEN
# draft: true
# skip_cleanup: true
# file: lagrit-$TRAVIS_OS_NAME
# on:
# tags: true
# - stage: Deploy Linux binary and publish
# deploy:
# provider: releases
# api_key: $GITHUB_OATH_TOKEN
# draft: false
# skip_cleanup: true
# file: lagrit-$TRAVIS_OS_NAME
# on:
# tags: true