Skip to content

Commit

Permalink
Merge pull request #2319 from gusano/topic/travis-non-Qt-builds
Browse files Browse the repository at this point in the history
Add non-qt build to travis (linux)
  • Loading branch information
vivid-synth authored Oct 9, 2016
2 parents 67dfbe0 + e535f23 commit 1426bcf
Show file tree
Hide file tree
Showing 12 changed files with 95 additions and 47 deletions.
72 changes: 25 additions & 47 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,48 @@
compiler:
- gcc

os:
- linux
- osx

sudo: required
dist: trusty
osx_image: xcode7.3
matrix:
fast_finish: true
include:
- os: linux
sudo: required
dist: trusty
env: QT=true
- os: linux
sudo: required
dist: trusty
env: QT=false
- os: osx
osx_image: xcode7.3
env: QT=true

cache:
- apt
- bundler

before_install:
- ifmac () { if [[ $TRAVIS_OS_NAME == osx ]]; then eval $@; fi; }
- iflin () { if [[ $TRAVIS_OS_NAME == linux ]]; then eval $@; fi; }
- ifmac brew update
- ifmac brew tap homebrew/versions
- ifmac brew outdated cmake || brew upgrade cmake
- ifmac brew install qt55 libsndfile python || true
- ifmac brew link qt55 --force
- iflin npm install -g lintspaces-cli
- iflin sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
- iflin sudo add-apt-repository --yes ppa:beineri/opt-qt551-trusty
- iflin sudo apt-get update
- iflin sudo apt-get install --yes build-essential gcc-4.9 g++-4.9 cmake pkg-config qt55base qt55location qt55declarative qt55sensors qt55tools qt55webengine qt55webchannel qt55webkit qt55xmlpatterns libjack-jackd2-dev libsndfile1-dev libasound2-dev libavahi-client-dev libreadline6-dev libfftw3-dev libicu-dev libxt-dev libudev-dev
- iflin sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
- iflin sudo update-alternatives --auto gcc
- $TRAVIS_BUILD_DIR/.travis/before-install-$TRAVIS_OS_NAME.sh --qt=$QT

before_script:
- iflin $TRAVIS_BUILD_DIR/.travis/lint.sh $TRAVIS_BUILD_DIR
- iflin source /opt/qt55/bin/qt55-env.sh
- mkdir BUILD
- cd BUILD
- mkdir BUILD && cd BUILD
- if [[ $QT == true ]]; then export QT_PREFIX=$HOME/qt/gcc_64; fi
- if [[ $QT == true ]]; then export QT_PLUGIN_PATH=$QT_PREFIX/plugins; fi

- export QT_PREFIX=$HOME/qt/gcc_64
- export QT_PLUGIN_PATH=$QT_PREFIX/plugins
- export COMMIT_NAME=$TRAVIS_COMMIT
- ifmac cmake -G"Xcode" -DCMAKE_PREFIX_PATH=`brew --prefix qt55` -DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 .. --debug-output
- iflin cmake -DSC_EL=no -DCMAKE_INSTALL_PREFIX:PATH=$PWD/Install -DCMAKE_BUILD_TYPE=Release .. --debug-output
# some paths
- ifmac export SCLANG=$TRAVIS_BUILD_DIR/BUILD/Install/SuperCollider/SuperCollider.app/Contents/MacOS/sclang
- iflin export SCLANG=$TRAVIS_BUILD_DIR/BUILD/Install/bin/sclang
- $TRAVIS_BUILD_DIR/.travis/before-script-$TRAVIS_OS_NAME.sh --qt=$QT
# prep for testing
- sudo pip install git+https://github.com/scztt/qpm.git@qpm-unit
- qpm quark checkout CommonTests CommonTestsGUI --location $HOME/Quarks
- cp ../travis_test_run_proto.json ./travis_test_run.json
- if [[ $QT == true ]]; then $TRAVIS_BUILD_DIR/.travis/qpm-prep.sh; fi

script:
# build
- iflin sudo make install
- ifmac cmake --build . --config Release --target install
# test
- $TRAVIS_BUILD_DIR/testsuite/sclang/launch_test.py $SCLANG
- qpm test.run -l ./travis_test_run.json --path $SCLANG --include $HOME/Quarks
# package
- ifmac mkdir -p $HOME/artifacts
- (ifmac cd Install; ifmac zip -q -r $HOME/artifacts/SC-$COMMIT_NAME.zip SuperCollider)
- $TRAVIS_BUILD_DIR/.travis/script-$TRAVIS_OS_NAME.sh
- $TRAVIS_BUILD_DIR/.travis/test.sh
- if [[ $TRAVIS_OS_NAME == osx ]]; then $TRAVIS_BUILD_DIR/.travis/package-osx.sh; fi

before_deploy:
# required for github releases
- git fetch --tags
- export BUILD_PREFIX=$TRAVIS_REPO_SLUG/$TRAVIS_OS_NAME
- export S3_BUILDS_LOCATION=builds/$BUILD_PREFIX
- export S3_URL=https://supercollider.s3.amazonaws.com/$S3_BUILDS_LOCATION/SC-$COMMIT_NAME.zip
- export S3_URL=https://supercollider.s3.amazonaws.com/$S3_BUILDS_LOCATION/SC-$TRAVIS_COMMIT.zip
- export FWD_HTML='<html><head><meta http-equiv="refresh" content="0; url='$S3_URL'" /></head></html>'
# put everything to be archived in artifacts/
- mkdir -p "$HOME/artifacts/${TRAVIS_BRANCH%/*}"
Expand All @@ -90,7 +68,7 @@ deploy:
# github releases - only tags
- provider: releases
api_key: $GITHUB_KEY
file: $HOME/artifacts/SC-$COMMIT_NAME.zip
file: $HOME/artifacts/SC-$TRAVIS_COMMIT.zip
prerelease: true
skip_cleanup: true
on:
Expand Down
12 changes: 12 additions & 0 deletions .travis/before-install-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

npm install -g lintspaces-cli
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
sudo add-apt-repository --yes ppa:beineri/opt-qt551-trusty
sudo apt-get update
sudo apt-get install --yes build-essential gcc-4.9 g++-4.9 cmake pkg-config libjack-jackd2-dev libsndfile1-dev libasound2-dev libavahi-client-dev libreadline6-dev libfftw3-dev libicu-dev libxt-dev libudev-dev
if [[ -n "$1" && "$1" == "--qt=true" ]]; then
sudo apt-get install --yes qt55base qt55location qt55declarative qt55sensors qt55tools qt55webengine qt55webchannel qt55webkit qt55xmlpatterns
fi
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
sudo update-alternatives --auto gcc
8 changes: 8 additions & 0 deletions .travis/before-install-osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

brew update
brew tap homebrew/versions
brew outdated cmake || brew upgrade cmake
brew install libsndfile python || true
brew install qt55 || true
brew link qt55 --force
9 changes: 9 additions & 0 deletions .travis/before-script-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

./lint.sh $TRAVIS_BUILD_DIR
if [[ -n "$1" && "$1" == "--qt=true" ]]; then
source /opt/qt55/bin/qt55-env.sh
cmake -DSC_EL=OFF -DCMAKE_INSTALL_PREFIX:PATH=$TRAVIS_BUILD_DIR/BUILD/Install -DCMAKE_BUILD_TYPE=Release $TRAVIS_BUILD_DIR --debug-output
else
cmake -DSC_EL=OFF -DSC_QT=OFF -DSC_IDE=OFF -DCMAKE_INSTALL_PREFIX:PATH=$TRAVIS_BUILD_DIR/BUILD/Install -DCMAKE_BUILD_TYPE=Release $TRAVIS_BUILD_DIR --debug-output
fi
3 changes: 3 additions & 0 deletions .travis/before-script-osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

cmake -G"Xcode" -DCMAKE_PREFIX_PATH=`brew --prefix qt55` -DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 $TRAVIS_BUILD_DIR --debug-output
4 changes: 4 additions & 0 deletions .travis/fix-non-Qt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

sudo mv $TRAVIS_BUILD_DIR/BUILD/Install/share/SuperCollider/SCClassLibrary/Common/GUI $TRAVIS_BUILD_DIR/BUILD/Install/share/SuperCollider/SCClassLibrary/scide_scqt/GUI
sudo mv $TRAVIS_BUILD_DIR/BUILD/Install/share/SuperCollider/SCClassLibrary/JITLib/GUI $TRAVIS_BUILD_DIR/BUILD/Install/share/SuperCollider/SCClassLibrary/scide_scqt/JITLibGUI
6 changes: 6 additions & 0 deletions .travis/package-osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

mkdir -p $HOME/artifacts

cd $TRAVIS_BUILD_DIR/BUILD/Install
zip -q -r $HOME/artifacts/SC-$TRAVIS_COMMIT.zip SuperCollider
6 changes: 6 additions & 0 deletions .travis/qpm-prep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

cd $TRAVIS_BUILD_DIR/BUILD
sudo pip install git+https://github.com/scztt/qpm.git@qpm-unit
qpm quark checkout CommonTests CommonTestsGUI --location $HOME/Quarks
cp ../travis_test_run_proto.json ./travis_test_run.json
3 changes: 3 additions & 0 deletions .travis/qpm-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

qpm test.run -l $TRAVIS_BUILD_DIR/BUILD/travis_test_run.json --path $SCLANG --include $HOME/Quarks
3 changes: 3 additions & 0 deletions .travis/script-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

sudo make install
3 changes: 3 additions & 0 deletions .travis/script-osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

cmake --build $TRAVIS_BUILD_DIR/BUILD --config Release --target install
13 changes: 13 additions & 0 deletions .travis/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

if [[ $TRAVIS_OS_NAME == linux ]]; then
export SCLANG=$TRAVIS_BUILD_DIR/BUILD/Install/bin/sclang
else
export SCLANG=$TRAVIS_BUILD_DIR/BUILD/Install/SuperCollider/SuperCollider.app/Contents/MacOS/sclang
fi

if [[ $QT != true ]]; then $TRAVIS_BUILD_DIR/.travis/fix-non-Qt.sh; fi

$TRAVIS_BUILD_DIR/testsuite/sclang/launch_test.py $SCLANG

if [[ $QT == true ]]; then $TRAVIS_BUILD_DIR/.travis/qpm-test.sh; fi

0 comments on commit 1426bcf

Please sign in to comment.