Skip to content

Commit af3f172

Browse files
committed
Merge pull request #56 from zbeekman/travis-build-matrix
Travis build matrix
2 parents c51d598 + 6301e88 commit af3f172

File tree

2 files changed

+63
-24
lines changed

2 files changed

+63
-24
lines changed

.travis.yml

Lines changed: 58 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,64 @@ language: python
33
python:
44
- 2.7
55

6+
cache: apt
7+
8+
# Build matrix: Run the three build systems and tests in parallel
9+
env:
10+
global:
11+
- DEPENDS=gfortran-4.9
12+
matrix:
13+
# CMake build with unit tests, no documentation
14+
# Allow to fail for now until tests are fixed
15+
- BUILD_SCRIPT="mkdir cmake-build && cd cmake-build && cmake -DSKIP_DOC_GEN:BOOL=TRUE .. && make -j 3 && (make test || true)"
16+
SPECIFIC_DEPENDS="cmake nodejs"
17+
JLINT="yes"
18+
DOCS="no"
19+
FoBiS="no"
20+
21+
# build with build.sh, make documentation, and do sniff test
22+
- BUILD_SCRIPT="./build.sh && cd bin && ./json"
23+
SPECIFIC_DEPENDS=""
24+
JLINT="no"
25+
DOCS="yes"
26+
FoBiS="yes"
27+
28+
# test scons build, no documentation or jsonlint, sniff test
29+
- BUILD_SCRIPT="scons && cd bin && ./json"
30+
SPECIFIC_DEPENDS=""
31+
JLINT="no"
32+
DOCS="no"
33+
FoBiS="no"
34+
635
before_install:
7-
- sudo apt-add-repository --yes ppa:ubuntu-toolchain-r/test
8-
- sudo apt-get update
9-
- sudo apt-get install gfortran-4.9
10-
- sudo ln -fs /usr/bin/gfortran-4.9 gfortran
11-
- sudo pip install FoBiS.py
12-
- wget http://rfsber.home.xs4all.nl/Robo/robodoc-4.99.41.tar.gz
13-
- gunzip robodoc-4.99.41.tar.gz
14-
- tar -xvf robodoc-4.99.41.tar
15-
- cd robodoc-4.99.41
16-
- ./configure
17-
- make
18-
- cd $TRAVIS_BUILD_DIR
19-
- export PATH="$TRAVIS_BUILD_DIR/robodoc-4.99.41/Source:$PATH"
20-
- export PATH=".:$PATH"
21-
22-
before_script:
23-
- ./build.sh
36+
- sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test
37+
- ([[ $SPECIFIC_DEPENDS == *cmake* ]] &&
38+
sudo apt-add-repository -y ppa:kalakris/cmake) ||
39+
[[ $SPECIFIC_DEPENDS != *cmake* ]]
40+
- ([[ $JLINT == [yY]* ]] &&
41+
curl -sL https://deb.nodesource.com/setup | sudo bash - ) ||
42+
([[ $JLINT != [yY]* ]] && sudo apt-get update -qq)
43+
- ([[ $DOCS == [yY]* ]] &&
44+
wget http://rfsber.home.xs4all.nl/Robo/robodoc-4.99.41.tar.gz) ||
45+
[[ $DOCS != [yY]* ]]
46+
47+
install:
48+
- sudo apt-get install -y $SPECIFIC_DEPENDS $DEPENDS
49+
- ([[ $JLINT == [yY]* ]] &&
50+
sudo npm install -g jsonlint)
51+
|| [[ $JLINT != [yY]* ]]
52+
- sudo ln -fs /usr/bin/gfortran-4.9 /usr/bin/gfortran && gfortran --version
53+
- ([[ $FoBiS == [yY]* ]] &&
54+
sudo pip install FoBiS.py && FoBiS.py --version) ||
55+
[[ $FoBiS != [yY]* ]]
56+
- ([[ $DOCS == [yY]* ]] &&
57+
tar -xzvf robodoc-4.99.41.tar.gz &&
58+
cd robodoc-4.99.41 &&
59+
./configure && make -j 3 && cd $TRAVIS_BUILD_DIR &&
60+
export PATH="$TRAVIS_BUILD_DIR/robodoc-4.99.41/Source:$PATH") ||
61+
[[ $DOCS != [yY]* ]]
62+
2463

2564
script:
26-
- cd bin
27-
- ./json
65+
- echo $BUILD_SCRIPT
66+
- echo $BUILD_SCRIPT | bash -

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# this software. The contributing author, Izaak Beekman, retains all
1010
# rights permitted by the terms of the json-fortran license.
1111

12-
cmake_minimum_required ( VERSION 2.8 FATAL_ERROR )
12+
cmake_minimum_required ( VERSION 2.8.8 FATAL_ERROR )
1313

1414
# Set the type/configuration of build to perform
1515
set ( CMAKE_CONFIGURATION_TYPES "Debug" "Release" "MinSizeRel" "RelWithDebInfo" )
@@ -120,9 +120,9 @@ set_target_properties ( test-${CMAKE_PROJECT_NAME} test-${CMAKE_PROJECT_NAME}-st
120120
#-------------------------------------
121121
# Build the documentation with ROBODoc
122122
#-------------------------------------
123-
set ( ROBODOC_SKIP_DOC_GEN FALSE CACHE BOOL
123+
set ( SKIP_DOC_GEN FALSE CACHE BOOL
124124
"Disable building the API documentation with ROBODoc" )
125-
if ( NOT ROBODOC_SKIP_DOC_GEN )
125+
if ( NOT SKIP_DOC_GEN )
126126
find_program ( ROBODOC robodoc )
127127
if ( ROBODOC ) # Found
128128
set ( ROBODOC_OPTIONS --rc ${CMAKE_SOURCE_DIR}/robodoc.rc --tabsize 4 --index --toc --sections --syntaxcolors --source_line_numbers
@@ -151,9 +151,9 @@ if ( NOT ROBODOC_SKIP_DOC_GEN )
151151
DEPENDS ${ROBODOC_OUTPUTS} )
152152
else ( ROBODOC ) # Not found
153153
message ( WARNING
154-
"ROBODoc not found! Please set the CMake cache variable ROBODOC to point to the installed ROBODoc binary, and reconfigure or disable building the documentation. ROBODoc can be installed from: http://www.xs4all.nl/~rfsber/Robo/ If you do not wish to install ROBODoc and build the json-fortran documentation, then please set the CMake cache variable SKIP_DOCUMENTATION_GENERATION to FALSE." )
154+
"ROBODoc not found! Please set the CMake cache variable ROBODOC to point to the installed ROBODoc binary, and reconfigure or disable building the documentation. ROBODoc can be installed from: http://www.xs4all.nl/~rfsber/Robo/ If you do not wish to install ROBODoc and build the json-fortran documentation, then please set the CMake cache variable SKIP_DOC_GEN to TRUE." )
155155
endif ( ROBODOC )
156-
endif ( NOT ROBODOC_SKIP_DOC_GEN )
156+
endif ( NOT SKIP_DOC_GEN )
157157

158158
#---------------------------------------------------------------------
159159
# Add some tests to ensure that the software is performing as expected

0 commit comments

Comments
 (0)