Change Travis config to utilize Build Stages

See: https://docs.travis-ci.com/user/build-stages/
This commit is contained in:
Jakub Jirutka authored and Nico Williams committed 2018-02-20 12:11:28 -05:00
1 parent bd34b8dd2e
commit c163e88af3
1 file changed
+51 -29
+51 -29
View File
@@ -1,46 +1,36 @@
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
stage: test
os: linux 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
- brew update || true;
brew install flex || true;
brew install bison || true;
- rvm install ruby-1.9.3-p551 - rvm install ruby-1.9.3-p551
- rvm use 1.9.3 - rvm use 1.9.3
- rm src/{lexer,parser}.{c,h} - rm src/{lexer,parser}.{c,h}
- sed -i.bak '/^AM_INIT_AUTOMAKE(\[-Wno-portability 1\.14\])$/s/14/11/' modules/oniguruma/configure.ac - 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
@@ -51,7 +41,7 @@ before_script:
- 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
@@ -77,18 +67,50 @@ script:
- make -j4 - make -j4
- make check -j4 - make check -j4
after_script: after_failure:
- |
if [ -n "$COVERAGE" ]; then
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 - cat test-suite.log
- cat tests/*.log - cat tests/*.log
# Build with clang and run tests on Ubuntu.
- <<: *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