Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use "phase" script for travis build phases. #127

Merged
merged 1 commit into from
Sep 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ language: c

matrix:
include:
- env: BUILD=hstox ENV=linux
- env: JOB=hstox ENV=linux
language: haskell
ghc: 7.8
- env: BUILD=toxcore ENV=linux
- env: JOB=toxcore ENV=linux
compiler: clang
- env: BUILD=toxcore ENV=linux
- env: JOB=toxcore ENV=linux
compiler: gcc
- env: BUILD=autotools ENV=linux
- env: JOB=autotools ENV=linux
compiler: clang

addons:
Expand Down Expand Up @@ -38,9 +38,9 @@ cache:
- $HOME/.ghc
- $HOME/cache

install: other/travis/${BUILD}-install
script: other/travis/${BUILD}-script
after_script: other/travis/${BUILD}-after_script
install: other/travis/phase $JOB $ENV install
script: other/travis/phase $JOB $ENV script
after_script: other/travis/phase $JOB $ENV after_script

notifications:
irc: "chat.freenode.net#toktok-status"
Expand Down
22 changes: 22 additions & 0 deletions other/travis/phase
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

set -e -u -x

JOB="$1"
ENV="$2"
PHASE="$3"

. "other/travis/env.sh"
. "other/travis/env-$ENV.sh"

try_source() {
SCRIPT="other/travis/$1"
if [ -f "$SCRIPT" ]; then
. "$SCRIPT"
fi
}

try_source "$PHASE"
try_source "$ENV-$PHASE"
try_source "$JOB-$PHASE"
try_source "$JOB-$ENV-$PHASE"