From 6549aefef436e5ef26fecfd01354d1a90910dae0 Mon Sep 17 00:00:00 2001 From: Ngie Cooper Date: Sun, 2 Apr 2017 13:03:06 -0700 Subject: [PATCH] Add necessary integration pieces for Travis CI - .travis.yml: provides the metadata for describing how the project should be built and tested. - travis/build.sh: builds the project. - travis/test.sh: tests the project. This commit adds support for the following matrix: - Ubuntu 14.04 LTS (trusty) x {clang,gcc} x {ext4} - Ubuntu 16.04 LTS (xenial) x {clang,gcc} x {ext4} Some initial scaffolding is filled in for OSX, but I haven't fully tested out the Travis CI integration, so I'm not yet throwing that switch. It seems to be beta supported, per https://docs.travis-ci.com/user/multi-os/ , so I might need to run the builds on my Mac hardware for the time being. Some administrative switches need to be flipped in order for this change to be made effective, but this has proven successful on my fork (yaneurabeya/pjdfstest). Fixes GitHub issue # 12 Capture more information for FreeBSD, Linux, and OSX FreeBSD isn't supported with Travis CI, but Linux definitely is, and OSX is partially supported. --- .travis.yml | 21 +++++++++++++++++++++ travis/build.sh | 6 ++++++ travis/test.sh | 27 +++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 .travis.yml create mode 100755 travis/build.sh create mode 100755 travis/test.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..93b2f6de --- /dev/null +++ b/.travis.yml @@ -0,0 +1,21 @@ +language: c +sudo: required + +matrix: + include: + - os: linux + compiler: clang + dist: trusty + - os: linux + compiler: gcc + dist: trusty + - os: linux + compiler: clang + dist: xenial + - os: linux + compiler: gcc + dist: xenial + +script: + - ./travis/build.sh + - ./travis/test.sh diff --git a/travis/build.sh b/travis/build.sh new file mode 100755 index 00000000..e6be5bf1 --- /dev/null +++ b/travis/build.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e + +cd $(dirname $0)/.. +make diff --git a/travis/test.sh b/travis/test.sh new file mode 100755 index 00000000..ee9ddf9e --- /dev/null +++ b/travis/test.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +set -ex + +cd $(dirname $0)/.. + +df . +uname -a + +case "$(uname)" in +Darwin) + sw_vers -productVersion + mount + ;; +FreeBSD) + mount -p + ;; +Linux) + for release_file in /etc/lsb-release /etc/os-release; do + echo "$release_file.. ->" + cat $release_file + done + mount + ;; +esac + +sudo prove -rv .