summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Esser <besser82@fedoraproject.org>2017-10-16 19:05:13 +0200
committerBjörn Esser <besser82@fedoraproject.org>2017-10-16 19:05:13 +0200
commit160b5251fb3c58f169f5a164adaba7ce918be248 (patch)
tree40d5162dca6e2282f247485b9c6c32a4a09186d1
parentab8d2052e4ec02c9fcbc6cffdf86fa1906ba2271 (diff)
downloadlibxcrypt-160b5251fb3c58f169f5a164adaba7ce918be248.tar.gz
libxcrypt-160b5251fb3c58f169f5a164adaba7ce918be248.tar.bz2
libxcrypt-160b5251fb3c58f169f5a164adaba7ce918be248.zip
Setup Travis CI and CodeCov
-rw-r--r--.gitignore2
-rw-r--r--.travis.env.in15
-rw-r--r--.travis.yml95
-rw-r--r--README3
4 files changed, 115 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 2973ee7..f6c0534 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,6 +34,8 @@
# compiler output
+*.gcda
+*.gcno
*.la
*.lo
*.log
diff --git a/.travis.env.in b/.travis.env.in
new file mode 100644
index 0000000..27bb2c0
--- /dev/null
+++ b/.travis.env.in
@@ -0,0 +1,15 @@
+TRAVIS=$TRAVIS
+CI=$CI
+TRAVIS_BRANCH=$TRAVIS_BRANCH
+TRAVIS_COMMIT=$TRAVIS_COMMIT
+TRAVIS_JOB_NUMBER=$TRAVIS_JOB_NUMBER
+TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST
+TRAVIS_JOB_ID=$TRAVIS_JOB_ID
+TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG
+TRAVIS_TAG=$TRAVIS_TAG
+TRAVIS_OS_NAME=$TRAVIS_OS_NAME
+TRAVIS_BUILD_DIR=/opt/libxcrypt
+TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH
+CC=$CC
+CXX=$CXX
+CONF=$CONF
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..5c81450
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,95 @@
+language: C
+
+branches:
+ except:
+ - master
+
+sudo: true
+
+matrix:
+ fast_finish: true
+ include:
+ - compiler: gcc
+ os: linux
+ services: docker
+ env:
+ - CONF="--enable-obsolete-api --enable-weak-hashes"
+ - FCVER="rawhide"
+ - CODECOV=1
+ - compiler: gcc
+ os: linux
+ services: docker
+ env:
+ - CONF="--enable-obsolete-api --enable-weak-hashes"
+ - FCVER="rawhide"
+ - compiler: clang
+ os: linux
+ services: docker
+ env:
+ - CONF="--enable-obsolete-api --enable-weak-hashes"
+ - FCVER="rawhide"
+ - compiler: gcc
+ os: linux
+ services: docker
+ env:
+ - CONF="--enable-obsolete-api --enable-weak-hashes"
+ - FCVER="latest"
+ - compiler: clang
+ os: linux
+ services: docker
+ env:
+ - CONF="--enable-obsolete-api --enable-weak-hashes"
+ - FCVER="latest"
+ - compiler: gcc
+ os: linux
+ services: docker
+ env:
+ - CONF="--disable-obsolete-api --disable-weak-hashes"
+ - FCVER="rawhide"
+ - compiler: clang
+ os: linux
+ services: docker
+ env:
+ - CONF="--disable-obsolete-api --disable-weak-hashes"
+ - FCVER="rawhide"
+ - compiler: gcc
+ os: linux
+ services: docker
+ env:
+ - CONF="--disable-obsolete-api --disable-weak-hashes"
+ - FCVER="latest"
+ - compiler: clang
+ os: linux
+ services: docker
+ env:
+ - CONF="--disable-obsolete-api --disable-weak-hashes"
+ - FCVER="latest"
+
+before_install:
+ - docker pull fedora:$FCVER
+ - perl -pe 's/\$(\w+)/$ENV{$1}/g' .travis.env.in > travis.env
+ - docker run -t -d -P --env-file travis.env --name buildenv -v $HOME/.ccache:/root/.ccache -v $PWD:/opt/libxcrypt fedora:$FCVER /bin/sh -c "mkdir -p /opt/libxcrypt ; bash"
+ - docker exec -t buildenv /bin/sh -c "dnf makecache"
+ - docker exec -t buildenv /bin/sh -c "dnf -y upgrade"
+ - docker exec -t buildenv /bin/sh -c "dnf -y --setopt=install_weak_deps=0 groupinstall buildsys-build"
+ - docker exec -t buildenv /bin/sh -c "dnf -y --setopt=install_weak_deps=0 install libtool"
+ - if [[ "$CC" == "clang" ]] ; then docker exec -t buildenv /bin/sh -c "dnf -y --setopt=install_weak_deps=0 install clang" ; fi
+ - if [[ "$CODECOV" == "1" ]] ; then docker exec -t buildenv /bin/sh -c "dnf -y --setopt=install_weak_deps=0 install '/usr/bin/git' '/usr/bin/lcov' '/usr/bin/pip3'" ; fi
+ - if [[ "$CODECOV" == "1" ]] ; then docker exec -t buildenv /bin/sh -c "pip3 install codecov" ; fi
+
+before_script:
+ - docker exec -t buildenv /bin/sh -c "rpm -E %optflags" > cflags.txt
+ - docker exec -t buildenv /bin/sh -c "rpm -E %__global_ldflags" > ldflags.txt
+ - export CFLAGS="`cat cflags.txt | tr -d '\012\015'` -Wno-unused-command-line-argument" ; export CXXFLAGS="$CFLAGS" ; echo $CFLAGS
+ - export LDFLAGS="`cat ldflags.txt| tr -d '\012\015'`" ; echo $LDFLAGS
+ - if [[ "$CODECOV" == "1" ]] ; then export CFLAGS="-O0 --coverage" ; export CXXFLAGS="$CFLAGS" ; export LDFLAGS="--coverage" ; fi
+ - docker exec -t buildenv /bin/sh -c "cd /opt/libxcrypt && autoreconf -fiv"
+ - docker exec -t buildenv /bin/sh -c "cd /opt/libxcrypt && CFLAGS=\"$CFLAGS\" CXXFLAGS=\"$CXXFLAGS\" LDFLAGS=\"$LDFLAGS\" ./configure --prefix=/opt/libxcrypt --disable-silent-rules --enable-shared --enable-static $CONF"
+
+script:
+ - docker exec -t buildenv /bin/sh -c "cd /opt/libxcrypt && make"
+ - docker exec -t buildenv /bin/sh -c "cd /opt/libxcrypt && make install"
+ - docker exec -t buildenv /bin/sh -c "cd /opt/libxcrypt && make check"
+
+after_success:
+ - if [[ "$CODECOV" == "1" ]] ; then docker exec -t buildenv /bin/sh -c "cd /opt/libxcrypt ; lcov --directory . --capture --output-file all_coverage.info ; lcov --remove all_coverage.info '/usr/*' > coverage.info ; rm -f all_coverage.info ; codecov -X gcov" ; fi
diff --git a/README b/README
index f63210e..568f558 100644
--- a/README
+++ b/README
@@ -1,3 +1,6 @@
+[![Build Status](https://travis-ci.org/besser82/libxcrypt.svg?branch=develop)](https://travis-ci.org/besser82/libxcrypt)
+[![codecov](https://codecov.io/gh/besser82/libxcrypt/branch/develop/graph/badge.svg)](https://codecov.io/gh/besser82/libxcrypt)
+
README for libxcrypt
====================