forked from jacobwilliams/json-fortran
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
175 lines (163 loc) · 4.92 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
language: python
python:
- 3.6
sudo: false
cache:
apt: true
pip: true
directories:
- $HOME/.cache/pip
- $HOME/.local
# Build matrix: Run the three build systems and tests in parallel
matrix:
include:
- os: linux
dist: trusty
addons:
apt:
sources:
- kalakris-cmake
- ubuntu-toolchain-r-test
packages:
- nodejs
- npm
- gfortran-6
- binutils
- cmake
- python-pip
env:
- GFORTRAN=gfortran-6
- GCOV=gcov-6
# CMake build with unit tests, no documentation, with coverage analysis
# No unicode so that coverage combined with the build script will cover unicode
# and non-unicode code paths
- BUILD_SCRIPT="mkdir cmake-build && cd cmake-build && cmake .. && make -j 4 check"
- CODE_COVERAGE="no"
- DEPLOY_DOCUMENTATION="no"
- os: linux
dist: trusty
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- nodejs
- npm
- gfortran-6
- binutils
- python-pip
- graphviz
env:
- GFORTRAN=gfortran-6
- GCOV=gcov-6
# build with build.sh, make documentation, run unit tests
# and perform coverage analysis
- BUILD_SCRIPT="./build.sh --coverage --skip-documentation && ./build.sh --coverage --enable-unicode"
- CODE_COVERAGE="yes"
- DEPLOY_DOCUMENTATION="yes"
- os: linux
dist: trusty
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- nodejs
- npm
- gfortran-7
- binutils
- python-pip
env:
- GFORTRAN=gfortran-7
- GCOV=gcov-7
# build with build.sh, run unit tests
- BUILD_SCRIPT="./build.sh --skip-documentation && ./build.sh --skip-documentation --enable-unicode"
- CODE_COVERAGE="no"
- DEPLOY_DOCUMENTATION="no"
- os: linux
dist: trusty
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- nodejs
- npm
- gfortran-8
- binutils
- python-pip
env:
- GFORTRAN=gfortran-8
- GCOV=gcov-8
# build with build.sh, run unit tests
- BUILD_SCRIPT="./build.sh --skip-documentation && ./build.sh --skip-documentation --enable-unicode"
- CODE_COVERAGE="no"
- DEPLOY_DOCUMENTATION="no"
- os: linux
dist: trusty
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- nodejs
- npm
- gfortran-9
- binutils
- python-pip
env:
- GFORTRAN=gfortran-9
- GCOV=gcov-9
# build with build.sh, run unit tests
- BUILD_SCRIPT="./build.sh --skip-documentation && ./build.sh --skip-documentation --enable-unicode"
- CODE_COVERAGE="no"
- DEPLOY_DOCUMENTATION="no"
install:
- |
if [[ ! -d "$HOME/.local/bin" ]]; then
mkdir "$HOME/.local/bin"
fi
- export PATH="$HOME/.local/bin:$PATH"
- export FC=/usr/bin/$GFORTRAN
- ln -fs $FC "$HOME/.local/bin/gfortran" && gfortran --version
- ls -l $FC
- ln -fs /usr/bin/$GCOV "$HOME/.local/bin/gcov" && gcov --version
- perl --version
- pip install --upgrade pygooglechart
- pip install --upgrade graphviz
- (pip install --upgrade FoBiS.py==2.2.8 && FoBiS.py --version)
- (pip install --upgrade ford==6.0.0 && ford --version)
- export NPM_PACKAGES="${HOME}/.npm-packages"
- mkdir "${HOME}/.npm-packages" || true
- npm config set prefix "${HOME}/.npm-packages"
- export PATH="${HOME}/.npm-packages/bin:$PATH"
- npm install -g jsonlint
- jsonlint --version || true # Why would you exit non-zero from --version ???!?!?! wth
before_script:
- |
if [ "$TRAVIS_TAG" ]; then
if [[ "v$TRAVIS_TAG" != "v$(cat .VERSION)" ]]; then
echo "ERROR: You are trying to tag a new release but have a version missmatch in \`.VERSION\`"
false # throw an error
fi
fi
script:
- echo $BUILD_SCRIPT
- bash <<<$BUILD_SCRIPT
after_success:
- cd $TRAVIS_BUILD_DIR
- git config --global user.name "TRAVIS-CI-for-$(git --no-pager show -s --format='%cn' $TRAVIS_COMMIT)"
- git config --global user.email "$(git --no-pager show -s --format='%ce' $TRAVIS_COMMIT)"
- |
if [[ $DEPLOY_DOCUMENTATION == [yY]* ]]; then
./deploy.sh #publish docs for master branch and tags
fi
- (yes | rm -r doc gh-pages) || true # wipe out doc dirs to avoid confusing codecov
- |
if [[ $CODE_COVERAGE == [yY]* ]]; then
alias gcov=$GCOV
rm json_*.F90-*unicode.gcov || true
mv json_*.F90.gcov src/
mv jf_test*.[fF]90.gcov src/tests/
bash <(curl -s https://codecov.io/bash) -v -X $GCOV
fi