Skip to content

Commit

Permalink
Merge pull request #7 from keneanung/AddTravis
Browse files Browse the repository at this point in the history
Add travis
  • Loading branch information
gamecreature authored May 16, 2017
2 parents 3e93b96 + 7e8bab8 commit f01d705
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
language: cpp
os:
- osx
- linux
dist: trusty
sudo: false
addons:
apt:
sources:
- sourceline: 'ppa:beineri/opt-qt562-trusty'
packages:
- qt56base
- qt56multimedia
- qt56tools
- xvfb
compiler:
- gcc
- clang
matrix:
exclude:
- os: osx
compiler: gcc
before_install: ./CI/travis.before_install.sh
install: ./CI/travis.install.sh
before_script:
- "export DISPLAY=:99.0"
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then sh -e /etc/init.d/xvfb start; fi
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then ( sudo Xvfb :99 -ac -screen 0 1024x768x8; echo ok ) & fi
- sleep 3 # give xvfb some time to start
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then PATH="/usr/local/opt/qt5/bin:$PATH"; fi
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then source /opt/qt56/bin/qt56-env.sh; fi
- mkdir build
script:
- cd build
- if [ "${CC}" = "clang" ] && [ "${TRAVIS_OS_NAME}" = "linux" ]; then SPEC="-spec linux-clang"; fi
- qmake ${SPEC} ../edbee-lib.pro && make -j2
- cd edbee-test
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then cd edbee-test.app/Contents/MacOS/; fi
- ./edbee-test
5 changes: 5 additions & 0 deletions CI/travis.before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
echo Before install on OSX.
./CI/travis.osx.before_install.sh;
fi
9 changes: 9 additions & 0 deletions CI/travis.install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
echo Install on OSX.
./CI/travis.osx.install.sh;
fi
if [ ! -z "${CXX}" ]; then
echo "Testing (possibly updated) compiler version:"
${CXX} --version;
fi
3 changes: 3 additions & 0 deletions CI/travis.osx.before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
set -ev
brew update
9 changes: 9 additions & 0 deletions CI/travis.osx.install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -ev
BREWS="qt5"
for i in $BREWS; do
brew outdated | grep -q $i && brew upgrade $i
done
for i in $BREWS; do
brew list | grep -q $i || brew install $i
done

0 comments on commit f01d705

Please sign in to comment.