Skip to content

Commit

Permalink
travis: add initial support
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Frysinger <vapier@gmail.com>
  • Loading branch information
vapier committed Nov 2, 2018
1 parent a2584f7 commit afcf2f4
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Travis build integration.
# https://docs.travis-ci.com/

language: c
# Order here matters for implicit matrix generation and coverity scan.
# See travis/main.sh for details.
compiler:
- gcc
- clang

sudo: false

# Order here matters; see compiler comment above.
os:
- linux
# - osx

script: ./travis/main.sh

addons:
apt:
packages:
- autoconf
- automake
38 changes: 38 additions & 0 deletions travis/lib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
# Common funcs for working w/Travis.

travis_fold() {
if [[ -n ${TRAVIS_OS_NAME} ]] ; then
printf 'travis_fold:%s:%s\r\n' "$@" | sed 's: :_:g'
fi
}

if [[ -n ${TRAVIS_OS_NAME} ]] ; then
whitebg=$(tput setab 7)
blackfg=$(tput setaf 0)
normal=$(tput sgr0)
else
whitebg=
blackbg=
normal=
fi
v() {
local fold=""
case $1 in
--fold=*) fold=${1:7}; shift;;
esac
if [[ -n ${fold} ]] ; then
travis_fold start "${fold}"
echo "\$ $*"
"$@"
travis_fold end "${fold}"
else
echo "${whitebg}${blackfg}\$ $*${normal}"
"$@"
fi
}

ncpus=$(getconf _NPROCESSORS_ONLN)
m() {
v make -j${ncpus} "$@"
}
10 changes: 10 additions & 0 deletions travis/main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -e
# The main script for building/testing while under travis ci.
# https://travis-ci.org/libgd/libgd

. "${0%/*}"/lib.sh

main() {
m distcheck
}
main "$@"

0 comments on commit afcf2f4

Please sign in to comment.