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.
pull/80/head
Bruno Pinto 9 years ago
parent 319c8a05cd
commit faba765a94

@ -1,39 +1,24 @@
language: c
os:
- linux
sudo: false
addons:
apt:
packages:
- bc
- doxygen
- expect
- gettext
- libncurses5-dev
- tree
sudo: required
services:
- docker
env:
global:
- PATH="$HOME/fish/bin:$PATH"
- OMF_REPO_URI="https://github.com/$TRAVIS_REPO_SLUG"
- OMF_REPO_BRANCH="$TRAVIS_BRANCH"
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:
- /bin/sh tools/travis_install_omf.sh
- tests/test_runner.fish
- tests/test-generate-themes-doc.fish
after_script:
- cd ~/.config/fish; tree -h; find . -type f | xargs cat
cache:
directories:
- $HOME/fish
- docker run -t -w "/root/.local/share/omf" oh-my-fish /usr/bin/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"
notifications:
email:

@ -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

@ -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
Loading…
Cancel
Save