Run tests on an isolated docker environment

- Install fish from dockerfile and generate a docker image.
- Install Oh My Fish! from downloaded git repository and generate a
  docker image.
This commit is contained in:
Bruno Pinto 2015-09-29 03:10:08 +01:00
parent 319c8a05cd
commit faba765a94
3 changed files with 11 additions and 59 deletions

View File

@ -1,39 +1,24 @@
language: c sudo: required
os:
- linux services:
sudo: false - docker
addons:
apt:
packages:
- bc
- doxygen
- expect
- gettext
- libncurses5-dev
- tree
env: env:
global: global:
- PATH="$HOME/fish/bin:$PATH"
- OMF_REPO_URI="https://github.com/$TRAVIS_REPO_SLUG" - OMF_REPO_URI="https://github.com/$TRAVIS_REPO_SLUG"
- OMF_REPO_BRANCH="$TRAVIS_BRANCH" - OMF_REPO_BRANCH="$TRAVIS_BRANCH"
before_install: before_install:
- tools/travis_install_fish.sh - docker build -t fish . < Dockerfile
before_script: pwd; tree -h before_script:
- docker run -e 'CI=WORKAROUND' -e "OMF_REPO_URI=$OMF_REPO_URI" -e "OMF_REPO_BRANCH=$OMF_REPO_BRANCH" -t -v $PWD:/src/oh-my-fish fish /usr/bin/fish -c "/src/oh-my-fish/bin/install"
- docker ps -a -q | xargs -i docker commit {} oh-my-fish
- docker run -t -w "/root/.local/share/omf" oh-my-fish /usr/bin/fish -c "export; tree -h"
script: script:
- /bin/sh tools/travis_install_omf.sh - docker run -t -w "/root/.local/share/omf" oh-my-fish /usr/bin/fish "tests/test_runner.fish"
- tests/test_runner.fish - docker run -t -w "/root/.local/share/omf" oh-my-fish /usr/bin/fish "tests/test-generate-themes-doc.fish"
- tests/test-generate-themes-doc.fish
after_script:
- cd ~/.config/fish; tree -h; find . -type f | xargs cat
cache:
directories:
- $HOME/fish
notifications: notifications:
email: email:

View File

@ -1,12 +0,0 @@
#!/bin/sh
set -e
BINDIR=$HOME/fish/bin
# check to see if fish bin doesn't exist
if [ ! -x "$BINDIR/fish" ]; then
cd /tmp
wget -O - https://github.com/fish-shell/fish-shell/releases/download/2.2.0/fish-2.2.0.tar.gz | tar xzv
cd fish-2.2.0 && ./configure --prefix=$HOME/fish && make -j2 && make install;
strip $BINDIR/fish $BINDIR/fish_indent $BINDIR/mimedb
else
echo 'Using cached directory.';
fi

View File

@ -1,21 +0,0 @@
#!/bin/sh
git () {
case $1 in
clone)
command git "$@"
if test "$TRAVIS_PULL_REQUEST" != "false"; then
echo "! detecting a pull request !"
echo "$ git -C $OMF_PATH fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge:"
git -C $OMF_PATH fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge:
echo "$ git -C $OMF_PATH checkout -qf FETCH_HEAD"
git -C $OMF_PATH checkout -qf FETCH_HEAD
fi
;;
*)
command git "$@"
;;
esac
}
. $TRAVIS_BUILD_DIR/bin/install