2014-12-22 21:37:23 -08:00
|
|
|
sudo: false
|
|
|
|
|
Adding a .travis.yml file to use the travis-ci.org
From wikipedia:
Travis CI is a hosted, distributed continuous integration service used
to build and test projects hosted at GitHub.
Travis CI is configured by adding a file named .travis.yml, which is a
YAML format text file, to the root directory of the GitHub repository.
Travis CI automatically detects when a commit has been made and pushed
to a GitHub repository that is using Travis CI, and each time this
happens, it will try to build the project and run tests. This includes
commits to all branches, not just to the master branch. When that
process has completed, it will notify a developer in the way it has been
configured to do so — for example, by sending an email containing the
test results (showing success or failure), or by posting a message on an
IRC channel. It can be configured to run the tests on a range of
different machines, with different software installed (such as older
versions of a programming language, to test for compatibility).
2013-12-12 16:23:07 +01:00
|
|
|
language: c
|
|
|
|
|
2018-02-09 00:44:13 +01:00
|
|
|
stages:
|
|
|
|
- name: test
|
|
|
|
|
|
|
|
- name: build
|
|
|
|
# Don't run build stage for pull requests to save time and resources.
|
|
|
|
if: type != pull_request
|
|
|
|
|
|
|
|
|
2018-02-09 00:03:44 +01:00
|
|
|
jobs:
|
2015-06-27 10:16:13 -07:00
|
|
|
include:
|
2018-02-09 00:03:44 +01:00
|
|
|
# Build with gcc and run tests on Ubuntu.
|
|
|
|
- &test-ubuntu
|
|
|
|
stage: test
|
|
|
|
os: linux
|
|
|
|
compiler: gcc
|
2019-02-20 21:01:17 -05:00
|
|
|
python: 3.6
|
2018-02-09 00:03:44 +01:00
|
|
|
|
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- valgrind
|
|
|
|
- bison
|
|
|
|
- automake
|
|
|
|
|
|
|
|
before_install:
|
|
|
|
- uname -s
|
2019-10-22 13:14:33 -04:00
|
|
|
- pyenv install -s 3.6.7
|
2018-02-09 00:03:44 +01:00
|
|
|
- rm src/{lexer,parser}.{c,h}
|
|
|
|
- sed -i.bak '/^AM_INIT_AUTOMAKE(\[-Wno-portability 1\.14\])$/s/14/11/' modules/oniguruma/configure.ac
|
|
|
|
|
|
|
|
install:
|
2019-10-22 13:14:33 -04:00
|
|
|
- pyenv global 3.6.7
|
2019-02-20 21:01:17 -05:00
|
|
|
- pip3 install pipenv
|
|
|
|
- pushd docs && pipenv sync && popd
|
2018-02-09 00:03:44 +01:00
|
|
|
- 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
|
|
|
|
- if [ -n "$COVERAGE" ]; then pip install --user cpp-coveralls; fi
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
# 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.
|
|
|
|
- PATH=/usr/local/opt/bison/bin:$PWD/usr/bin:$PATH
|
|
|
|
- echo SHELL=$SHELL
|
|
|
|
- echo PATH=$PATH
|
|
|
|
- which bison
|
|
|
|
- bison --version
|
|
|
|
- autoreconf -if
|
|
|
|
- ./configure --with-oniguruma=builtin YACC="$(which bison) -y" $COVERAGE
|
|
|
|
|
|
|
|
script:
|
|
|
|
# When using the bison from Debian we need to tell that bison where
|
|
|
|
# to find its data. Yay non-relocatable code. Not.
|
|
|
|
- echo PATH=$PATH
|
|
|
|
- which bison
|
|
|
|
- make BISON_PKGDATADIR=$PWD/usr/share/bison src/parser.c || make src/parser.c
|
|
|
|
# Make dist!
|
|
|
|
#
|
|
|
|
# Make it first to fail the build early, before we test with
|
|
|
|
# valgrind.
|
|
|
|
- make dist
|
|
|
|
# Build and test the dist (without valgrind)
|
|
|
|
- |
|
|
|
|
(
|
|
|
|
tar xvf jq-`scripts/version`.tar.gz &&
|
|
|
|
cd jq-`scripts/version` &&
|
|
|
|
pwd &&
|
|
|
|
./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 -j4 &&
|
|
|
|
make check -j4 || true
|
|
|
|
)
|
|
|
|
# Build and test the HEAD
|
|
|
|
- make -j4
|
|
|
|
- make check -j4
|
|
|
|
|
|
|
|
after_failure:
|
|
|
|
- cat test-suite.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
|
2018-08-30 22:03:32 -04:00
|
|
|
- brew install flex bison
|
2019-10-22 13:14:33 -04:00
|
|
|
- brew upgrade pyenv
|
|
|
|
- pyenv install -s 3.6.7
|
2018-02-09 00:03:44 +01:00
|
|
|
- rm src/{lexer,parser}.{c,h}
|
|
|
|
- sed -i.bak '/^AM_INIT_AUTOMAKE(\[-Wno-portability 1\.14\])$/s/14/11/' modules/oniguruma/configure.ac
|
|
|
|
|
|
|
|
install:
|
2019-10-22 13:14:33 -04:00
|
|
|
- pyenv global 3.6.7
|
2019-02-20 21:01:17 -05:00
|
|
|
- pip3 install pipenv
|
|
|
|
- pushd docs && pipenv sync && popd
|
2018-02-09 00:03:44 +01:00
|
|
|
- if [ -n "$COVERAGE" ]; then pip install --user cpp-coveralls; fi
|
|
|
|
|
|
|
|
|
|
|
|
# Build with clang and run tests on macOS.
|
|
|
|
- <<: *test-osx
|
|
|
|
compiler: clang
|
Adding a .travis.yml file to use the travis-ci.org
From wikipedia:
Travis CI is a hosted, distributed continuous integration service used
to build and test projects hosted at GitHub.
Travis CI is configured by adding a file named .travis.yml, which is a
YAML format text file, to the root directory of the GitHub repository.
Travis CI automatically detects when a commit has been made and pushed
to a GitHub repository that is using Travis CI, and each time this
happens, it will try to build the project and run tests. This includes
commits to all branches, not just to the master branch. When that
process has completed, it will notify a developer in the way it has been
configured to do so — for example, by sending an email containing the
test results (showing success or failure), or by posting a message on an
IRC channel. It can be configured to run the tests on a range of
different machines, with different software installed (such as older
versions of a programming language, to test for compatibility).
2013-12-12 16:23:07 +01:00
|
|
|
|
2018-02-09 00:26:55 +01:00
|
|
|
|
|
|
|
# Build with gcc and run tests on Alpine Linux v3.7 (inside chroot).
|
|
|
|
# Note: Alpine uses musl libc.
|
|
|
|
- &test-alpine
|
|
|
|
stage: test
|
|
|
|
os: linux
|
|
|
|
language: minimal
|
|
|
|
compiler: gcc
|
|
|
|
sudo: true
|
|
|
|
|
|
|
|
before_install:
|
|
|
|
- "wget 'https://raw.githubusercontent.com/alpinelinux/alpine-chroot-install/v0.7.0/alpine-chroot-install' \
|
|
|
|
&& echo '090d323d887ef3a2fd4e752428553f22a52b87bb alpine-chroot-install' | sha1sum -c || travis_terminate 1"
|
|
|
|
- alpine() { /alpine/enter-chroot -u "$USER" "$@"; }
|
|
|
|
|
|
|
|
install:
|
|
|
|
- sudo sh alpine-chroot-install -b v3.7 -a "$ARCH"
|
2019-02-20 21:01:17 -05:00
|
|
|
-p 'build-base automake autoconf bison git libtool oniguruma-dev python3 python3-dev libxml2-dev libxslt-dev'
|
|
|
|
- /alpine/enter-chroot pip3 install pipenv
|
|
|
|
- alpine sh -c 'cd docs && pipenv sync'
|
2018-02-09 00:26:55 +01:00
|
|
|
|
|
|
|
before_script:
|
|
|
|
- autoreconf -if
|
|
|
|
|
|
|
|
script:
|
|
|
|
- alpine ./configure --disable-docs
|
|
|
|
- alpine make
|
|
|
|
- alpine make check
|
|
|
|
|
2019-02-20 21:01:17 -05:00
|
|
|
after_failure:
|
|
|
|
- cat test-suite.log
|
|
|
|
- cat tests/*.log
|
2018-02-09 00:26:55 +01:00
|
|
|
|
2018-02-09 00:44:13 +01:00
|
|
|
# Build release binary statically linked with musl libc on Alpine Linux
|
|
|
|
# (inside chroot). If building a tagged commit, then deploy release
|
|
|
|
# tarball to GitHub Releases.
|
|
|
|
- &build-alpine
|
|
|
|
<<: *test-alpine
|
|
|
|
stage: build
|
|
|
|
env: ARCH=x86_64
|
|
|
|
|
|
|
|
script:
|
|
|
|
- alpine ./configure --disable-docs --enable-all-static
|
|
|
|
CFLAGS='-Os -static -no-pie' CXXFLAGS='-Os -static -no-pie'
|
|
|
|
- alpine make
|
|
|
|
- alpine strip jq
|
|
|
|
|
|
|
|
- jq -V
|
|
|
|
- ls -lah jq
|
|
|
|
- file jq
|
|
|
|
# Ensure that the built executable is really statically linked.
|
|
|
|
- file jq | grep -Fw 'statically linked'
|
|
|
|
|
|
|
|
before_deploy:
|
|
|
|
- PKGNAME="jq-$TRAVIS_TAG-$ARCH-linux"
|
|
|
|
- mkdir $PKGNAME && mv jq $PKGNAME/
|
|
|
|
- tar -czf $PKGNAME.tar.gz $PKGNAME/
|
|
|
|
- sha256sum $PKGNAME.tar.gz > $PKGNAME.tar.gz.sha256
|
|
|
|
|
|
|
|
deploy:
|
|
|
|
provider: releases
|
|
|
|
api_key:
|
|
|
|
secure: # TODO: put encrypted GitHub token here!
|
|
|
|
file: jq-$TRAVIS_TAG-*.tar.gz*
|
|
|
|
file_glob: true
|
|
|
|
skip_cleanup: true
|
|
|
|
on:
|
|
|
|
tags: true
|
|
|
|
|
|
|
|
# Build binaries for other architectures using QEMU user-mode emulation.
|
|
|
|
- <<: *build-alpine
|
|
|
|
env: ARCH=x86
|
|
|
|
|
|
|
|
- <<: *build-alpine
|
|
|
|
env: ARCH=aarch64
|
|
|
|
|
|
|
|
- <<: *build-alpine
|
|
|
|
env: ARCH=armhf
|
|
|
|
|
|
|
|
- <<: *build-alpine
|
|
|
|
env: ARCH=ppc64le
|
|
|
|
|
|
|
|
|
Adding a .travis.yml file to use the travis-ci.org
From wikipedia:
Travis CI is a hosted, distributed continuous integration service used
to build and test projects hosted at GitHub.
Travis CI is configured by adding a file named .travis.yml, which is a
YAML format text file, to the root directory of the GitHub repository.
Travis CI automatically detects when a commit has been made and pushed
to a GitHub repository that is using Travis CI, and each time this
happens, it will try to build the project and run tests. This includes
commits to all branches, not just to the master branch. When that
process has completed, it will notify a developer in the way it has been
configured to do so — for example, by sending an email containing the
test results (showing success or failure), or by posting a message on an
IRC channel. It can be configured to run the tests on a range of
different machines, with different software installed (such as older
versions of a programming language, to test for compatibility).
2013-12-12 16:23:07 +01:00
|
|
|
notifications:
|
|
|
|
email: false
|
2015-08-25 15:36:54 +01:00
|
|
|
|