mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-01-20 00:52:45 +08:00
commit
e40f2d3ceb
39
.travis.yml
39
.travis.yml
|
@ -1,40 +1,25 @@
|
|||
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
|
||||
- fish -c 'ln -sf $TRAVIS_BUILD_DIR/tests/functions_override $fish_function_path[1]'
|
||||
- export OMF_REPO_BRANCH=`tools/branch-name.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:
|
||||
|
|
11
Dockerfile
Normal file
11
Dockerfile
Normal file
|
@ -0,0 +1,11 @@
|
|||
FROM ubuntu
|
||||
|
||||
RUN echo "Installing fish"
|
||||
RUN sudo apt-get install -y software-properties-common && \
|
||||
sudo apt-add-repository ppa:fish-shell/release-2 && \
|
||||
sudo apt-get -y update && \
|
||||
sudo apt-get -y install fish
|
||||
|
||||
RUN echo "Installing dependencies"
|
||||
RUN sudo apt-get -y install curl git tree
|
||||
|
|
@ -5,5 +5,5 @@
|
|||
# Refresh (reload) the current fish session.
|
||||
|
||||
function refresh -d "refresh the fish session"
|
||||
exec fish < /dev/tty
|
||||
set -q CI; or exec fish < /dev/tty
|
||||
end
|
||||
|
|
|
@ -20,5 +20,5 @@ function omf.destroy -d "Remove Oh My Fish"
|
|||
rm -rf "$OMF_PATH"
|
||||
end
|
||||
|
||||
exec fish < /dev/tty
|
||||
set -q CI; or exec fish < /dev/tty
|
||||
end
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
# SYNOPSIS
|
||||
# refresh
|
||||
#
|
||||
# OVERVIEW
|
||||
# Refresh (reload) the current fish session.
|
||||
|
||||
function refresh -d "refresh the fish session (Travis Override)"
|
||||
echo !!! Shell refresh requested in testing Environment !!!
|
||||
exit 0;
|
||||
end
|
16
tools/branch-name.sh
Executable file
16
tools/branch-name.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
URL=https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST
|
||||
|
||||
BRANCH_NAME=`curl -s $URL ^/dev/null \
|
||||
| grep -C 2 "head" \
|
||||
| grep \"ref\" \
|
||||
| cut -d':' -f2- \
|
||||
| sed -e 's/["|,]//g;s/^[ \t]//g'
|
||||
`
|
||||
|
||||
if [ -n "$BRANCH_NAME" ]; then
|
||||
echo $BRANCH_NAME
|
||||
else
|
||||
echo $TRAVIS_BRANCH
|
||||
fi
|
|
@ -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…
Reference in New Issue
Block a user