Change Travis config to utilize Build Stages
See: https://docs.travis-ci.com/user/build-stages/
This commit is contained in:
1 parent
bd34b8dd2e
commit
c163e88af3
1 file changed
+100
-78
+100
-78
@@ -1,93 +1,115 @@
|
|||||||
os:
|
|
||||||
- linux
|
|
||||||
- osx
|
|
||||||
|
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
language: c
|
language: c
|
||||||
|
|
||||||
compiler:
|
jobs:
|
||||||
- gcc
|
|
||||||
- clang
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
include:
|
include:
|
||||||
- compiler: gcc
|
# Build with gcc and run tests on Ubuntu.
|
||||||
env: COVERAGE="--disable-valgrind --enable-gcov"
|
- &test-ubuntu
|
||||||
os: linux
|
stage: test
|
||||||
|
os: linux
|
||||||
|
compiler: gcc
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- valgrind
|
- valgrind
|
||||||
- bison
|
- bison
|
||||||
- automake
|
- automake
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- echo "$TRAVIS_OS_NAME"
|
- uname -s
|
||||||
- uname -s
|
- rvm install ruby-1.9.3-p551
|
||||||
- brew update || true;
|
- rvm use 1.9.3
|
||||||
brew install flex || true;
|
- rm src/{lexer,parser}.{c,h}
|
||||||
brew install bison || true;
|
- sed -i.bak '/^AM_INIT_AUTOMAKE(\[-Wno-portability 1\.14\])$/s/14/11/' modules/oniguruma/configure.ac
|
||||||
- rvm install ruby-1.9.3-p551
|
|
||||||
- rvm use 1.9.3
|
|
||||||
- rm src/{lexer,parser}.{c,h}
|
|
||||||
- sed -i.bak '/^AM_INIT_AUTOMAKE(\[-Wno-portability 1\.14\])$/s/14/11/' modules/oniguruma/configure.ac
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- bundle install --gemfile=docs/Gemfile
|
- bundle install --gemfile=docs/Gemfile
|
||||||
- wget http://ftp.debian.org/debian/pool/main/b/bison/bison_3.0.2.dfsg-2_amd64.deb
|
- wget http://ftp.debian.org/debian/pool/main/b/bison/bison_3.0.2.dfsg-2_amd64.deb
|
||||||
- ar p bison_3.0.2.dfsg-2_amd64.deb data.tar.xz | tar xJ
|
- ar p bison_3.0.2.dfsg-2_amd64.deb data.tar.xz | tar xJ
|
||||||
- if [ -n "$COVERAGE" ]; then pip install --user cpp-coveralls; fi
|
- if [ -n "$COVERAGE" ]; then pip install --user cpp-coveralls; fi
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
# If this is OS X we'll get bison from brew, else we'll get bison
|
# If this is OS X we'll get bison from brew, else we'll get bison
|
||||||
# from the .deb unpacked above in the install section.
|
# from the .deb unpacked above in the install section.
|
||||||
- PATH=/usr/local/opt/bison/bin:$PWD/usr/bin:$PATH
|
- PATH=/usr/local/opt/bison/bin:$PWD/usr/bin:$PATH
|
||||||
- echo SHELL=$SHELL
|
- echo SHELL=$SHELL
|
||||||
- echo PATH=$PATH
|
- echo PATH=$PATH
|
||||||
- which bison
|
- which bison
|
||||||
- bison --version
|
- bison --version
|
||||||
- autoreconf -if
|
- autoreconf -if
|
||||||
- ./configure --with-oniguruma=builtin YACC="$(which bison) -y" $COVERAGE
|
- ./configure --with-oniguruma=builtin YACC="$(which bison) -y" $COVERAGE
|
||||||
|
|
||||||
script:
|
script:
|
||||||
# When using the bison from Debian we need to tell that bison where
|
# When using the bison from Debian we need to tell that bison where
|
||||||
# to find its data. Yay non-relocatable code. Not.
|
# to find its data. Yay non-relocatable code. Not.
|
||||||
- echo PATH=$PATH
|
- echo PATH=$PATH
|
||||||
- which bison
|
- which bison
|
||||||
- make BISON_PKGDATADIR=$PWD/usr/share/bison src/parser.c || make src/parser.c
|
- make BISON_PKGDATADIR=$PWD/usr/share/bison src/parser.c || make src/parser.c
|
||||||
# Make dist!
|
# Make dist!
|
||||||
#
|
#
|
||||||
# Make it first to fail the build early, before we test with
|
# Make it first to fail the build early, before we test with
|
||||||
# valgrind.
|
# valgrind.
|
||||||
- make dist
|
- make dist
|
||||||
# Build and test the dist (without valgrind)
|
# Build and test the dist (without valgrind)
|
||||||
- |
|
- |
|
||||||
(
|
(
|
||||||
tar xvf jq-`scripts/version`.tar.gz &&
|
tar xvf jq-`scripts/version`.tar.gz &&
|
||||||
cd jq-`scripts/version` &&
|
cd jq-`scripts/version` &&
|
||||||
pwd &&
|
pwd &&
|
||||||
./configure --disable-valgrind --with-oniguruma=builtin YACC="$(which bison) -y" $COVERAGE &&
|
./configure --disable-valgrind --with-oniguruma=builtin YACC="$(which bison) -y" $COVERAGE &&
|
||||||
make BISON_PKGDATADIR=$PWD/usr/share/bison src/parser.c || make src/parser.c &&
|
make BISON_PKGDATADIR=$PWD/usr/share/bison src/parser.c || make src/parser.c &&
|
||||||
make -j4 &&
|
make -j4 &&
|
||||||
make check -j4 || true
|
make check -j4 || true
|
||||||
)
|
)
|
||||||
# Build and test the HEAD
|
# Build and test the HEAD
|
||||||
- make -j4
|
- make -j4
|
||||||
- make check -j4
|
- make check -j4
|
||||||
|
|
||||||
after_script:
|
after_failure:
|
||||||
- |
|
- cat test-suite.log
|
||||||
if [ -n "$COVERAGE" ]; then
|
- cat tests/*.log
|
||||||
rm -rf src/.libs # don't care about coverage for libjq
|
|
||||||
coveralls --gcov-options '\-lp' \
|
|
||||||
-e src/lexer.c -e src/parser.c -e src/jv_dtoa.c
|
|
||||||
fi
|
|
||||||
|
|
||||||
after_failure:
|
|
||||||
- cat test-suite.log
|
# Build with clang and run tests on Ubuntu.
|
||||||
- cat tests/*.log
|
- <<: *test-ubuntu
|
||||||
|
compiler: clang
|
||||||
|
|
||||||
|
|
||||||
|
# Build with gcc and run tests with gcov on Ubuntu.
|
||||||
|
- <<: *test-ubuntu
|
||||||
|
env: COVERAGE="--disable-valgrind --enable-gcov"
|
||||||
|
|
||||||
|
after_script:
|
||||||
|
- rm -rf src/.libs # don't care about coverage for libjq
|
||||||
|
- coveralls --gcov-options '\-lp'
|
||||||
|
-e src/lexer.c -e src/parser.c -e src/jv_dtoa.c
|
||||||
|
|
||||||
|
|
||||||
|
# Build with gcc and run tests on macOS.
|
||||||
|
- &test-osx
|
||||||
|
<<: *test-ubuntu
|
||||||
|
os: osx
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- uname -s
|
||||||
|
- brew update
|
||||||
|
- brew install flex
|
||||||
|
- brew install bison
|
||||||
|
- rvm install ruby-1.9.3-p551
|
||||||
|
- rvm use 1.9.3
|
||||||
|
- rm src/{lexer,parser}.{c,h}
|
||||||
|
- sed -i.bak '/^AM_INIT_AUTOMAKE(\[-Wno-portability 1\.14\])$/s/14/11/' modules/oniguruma/configure.ac
|
||||||
|
|
||||||
|
install:
|
||||||
|
- bundle install --gemfile=docs/Gemfile
|
||||||
|
- if [ -n "$COVERAGE" ]; then pip install --user cpp-coveralls; fi
|
||||||
|
|
||||||
|
|
||||||
|
# Build with clang and run tests on macOS.
|
||||||
|
- <<: *test-osx
|
||||||
|
compiler: clang
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
|
|||||||
Reference in new issue
Block a user