Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update travis setting * Update after failure script * Fix lint * Update comment * Test bot * Update ci script * Update ci * Test lint * Update ci * Check var * Use log file * Fix lint * Check -f * Lint * Fix json * Use vim script instead * Fixup * quit afte comment * Update lint * Fix lint * Install gvim * Remove file * Install vim before test * Fix lint * Fix github api * Use neovim report error * Update travis * Fix unkonwn command * Use origin/dev * Update lint * Fix unkown command * Fix lint * Update config * Fix lint * Fix cache * Fix cache * Fix neovim install * Fix neovim install * Fix install * Use dockerfile * Fix lint * Update install script * Fix lint * Fix type * Fix alow faile * Fix jobs * Fix docker * Fix docker * Fix makefile * Update commenter vim script
- Loading branch information
Showing
10 changed files
with
233 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ "$TRAVIS_PULL_REQUEST" != "false" ] ; then | ||
if [ "$LINT" = "vimlint-errors" ] ; then | ||
if [[ -f build_log ]]; then | ||
if [[ -d build/GitHub.vim ]]; then | ||
rm -rf build/GitHub.vim | ||
fi | ||
VIMLINT_LOG=`cat build_log` | ||
echo "$VIMLINT_LOG" | ||
git clone https://github.com/wsdjeg/GitHub.vim.git build/GitHub.vim | ||
docker run -it --rm \ | ||
-v $PWD/.ci:/.ci \ | ||
-v $PWD/build:/build \ | ||
spacevim/vims neovim-stable -u .ci/common/github_commenter.vim | ||
rm build_log | ||
fi | ||
elif [ "$LINT" = "vint-errors" ] ; then | ||
if [[ -f build_log ]]; then | ||
if [[ -d build/GitHub.vim ]]; then | ||
rm -rf build/GitHub.vim | ||
fi | ||
VIMLINT_LOG=`cat build_log` | ||
echo "$VIMLINT_LOG" | ||
git clone https://github.com/wsdjeg/GitHub.vim.git build/GitHub.vim | ||
docker run -it --rm \ | ||
-v $PWD/.ci:/.ci \ | ||
-v $PWD/build:/build \ | ||
spacevim/vims neovim-stable -u .ci/common/github_commenter.vim | ||
rm build_log | ||
fi | ||
elif [ "$LINT" = "vader" ] ; then | ||
echo "" | ||
fi | ||
fi |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
exe 'set nocp' | ||
set rtp+=build/GitHub.vim | ||
so build/GitHub.vim/plugin/github.vim | ||
so build/GitHub.vim/autoload/github/api/issues.vim | ||
so build/GitHub.vim/autoload/github/api/util.vim | ||
let s:log = filereadable('build_log') ? system('cat build_log') : '' | ||
function! s:update_log(log, summary, new_log) abort | ||
let log = split(a:log, "\n") | ||
let begin = -1 | ||
let end = -1 | ||
for i in range(len(log)) | ||
if log[i] =~ a:summary | ||
let begin = i | ||
endif | ||
if begin != -1 && log[i] ==# '</details>' | ||
let end = i | ||
endif | ||
endfor | ||
return a:log . "\n" . a:new_log | ||
|
||
endfunction | ||
if !empty(s:log) | ||
if $LINT == 'vader' | ||
let s:summary = $VIM . ' ' . $LINT . ' build log' | ||
else | ||
let s:summary = $LINT . ' build log' | ||
endif | ||
let s:log = '<details><summary>' . s:summary . "</summary>\n" . s:log . "\n</details>" | ||
let s:comments = github#api#issues#List_comments('SpaceVim', 'SpaceVim',$TRAVIS_PULL_REQUEST ,'') | ||
if empty(s:comments) | ||
call github#api#issues#Create_comment('SpaceVim','SpaceVim', $TRAVIS_PULL_REQUEST, {'body': s:log}, 'SpaceVimBot', $BOTSECRET) | ||
else | ||
let s:nr = 0 | ||
for s:comment in s:comments | ||
if s:comment.user.login ==# 'SpaceVimBot' | ||
let s:nr = s:comment.id | ||
break | ||
endif | ||
endfor | ||
if s:nr == 0 | ||
call github#api#issues#Create_comment('SpaceVim','SpaceVim', $TRAVIS_PULL_REQUEST, {'body': s:log}, 'SpaceVimBot', $BOTSECRET) | ||
else | ||
call github#api#issues#Edit_comment('SpaceVim','SpaceVim', s:nr, | ||
\ {'body': s:update_log(s:comment.body, s:summary, s:log)}, 'SpaceVimBot', $BOTSECRET) | ||
endif | ||
endif | ||
endif | ||
quit |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Fail on unset variables and command errors | ||
set -ue -o pipefail | ||
|
||
# Prevent commands misbehaving due to locale differences | ||
export LC_ALL=C | ||
|
||
docker pull spacevim/vims | ||
|
||
git fetch origin dev:dev | ||
|
||
if [ "${LINT#vimlint}" != "$LINT" ]; then | ||
git clone --depth=1 https://github.com/syngan/vim-vimlint /tmp/vimlint | ||
git clone --depth=1 https://github.com/ynkdir/vim-vimlparser /tmp/vimlparser | ||
elif [ "${LINT#vint}" != "$LINT" ]; then | ||
pip install vim-vint | ||
elif [ "${LINT#vader}" != "$LINT" ]; then | ||
git clone --depth=1 https://github.com/Shougo/dein.vim.git ~/.cache/vimfiles/repos/github.com/Shougo/dein.vim | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
install_vim() { | ||
local URL=https://github.com/vim/vim | ||
local tag=$1 | ||
local ext=$([[ $tag == "HEAD" ]] && echo "" || echo "-b $tag") | ||
local tmp="$(mktemp -d)" | ||
local out="$HOME/cache/vim-$tag" | ||
local ncpu=$(awk '/^processor/{n+=1}END{print n}' /proc/cpuinfo) | ||
git clone --depth 1 --single-branch $ext $URL $tmp | ||
cd $tmp | ||
./configure --prefix=$out \ | ||
--enable-fail-if-missing \ | ||
--with-features=huge \ | ||
--enable-pythoninterp \ | ||
--enable-python3interp \ | ||
--enable-luainterp | ||
make -j$ncpu | ||
make install | ||
ln -s $out $HOME/vim | ||
} | ||
|
||
install_nvim() { | ||
local URL=https://github.com/neovim/neovim | ||
local tag=$1 | ||
local ext=$([[ $tag == "HEAD" ]] && echo "" || echo "-b $tag") | ||
local tmp="$(mktemp -d)" | ||
local out="$HOME/cache/nvim-$tag" | ||
local ncpu=$(awk '/^processor/{n+=1}END{print n}' /proc/cpuinfo) | ||
git clone --depth 1 --single-branch $ext $URL $tmp | ||
cd $tmp | ||
make deps | ||
make -j$ncpu \ | ||
CMAKE_BUILD_TYPE=Release \ | ||
CMAKE_EXTRA_FLAGS="-DTRAVIS_CI_BUILD=ON -DCMAKE_INSTALL_PREFIX:PATH=$out" | ||
make install | ||
python -m pip install --user neovim | ||
python3 -m pip install --user neovim | ||
ln -sf $out $HOME/vim | ||
} | ||
|
||
install() { | ||
local vim=$1 | ||
local tag=$2 | ||
|
||
[[ -d $HOME/vim ]] && rm -f $HOME/vim | ||
if [[ $tag != "HEAD" ]] && [[ -d "$HOME/cache/$vim-$tag" ]]; then | ||
echo "Use a cached version '$HOME/cache/$vim-$tag'." | ||
ln -sf $HOME/cache/$vim-$tag $HOME/vim | ||
return | ||
fi | ||
if [[ $vim == "nvim" ]]; then | ||
install_nvim $tag | ||
else | ||
install_vim $tag | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
if [ "$LINT" = "vimlint" ]; then | ||
for file in $(git diff --name-only HEAD dev | grep .vim$); | ||
do | ||
sh /tmp/vimlint/bin/vimlint.sh -l /tmp/vimlint -p /tmp/vimlparser $file; | ||
done | ||
elif [ "$LINT" = "vimlint-errors" ]; then | ||
if [[ -f build_log ]]; then | ||
rm build_log | ||
fi | ||
for file in $(git diff --name-only HEAD dev | grep .vim$); | ||
do | ||
/tmp/vimlint/bin/vimlint.sh -E -l /tmp/vimlint -p /tmp/vimlparser $file >> build_log; | ||
done | ||
if [[ -f build_log ]]; then | ||
cat build_log | ||
exit 2 | ||
fi | ||
elif [ "$LINT" = "vint" ]; then | ||
vint . | ||
elif [ "$LINT" = "vint-errors" ]; then | ||
vint --error . | ||
elif [ "$LINT" = "vader" ]; then | ||
pip install covimerage | ||
make test_coverage | ||
covimerage -vv xml --omit 'build/*' | ||
pip install codecov | ||
codecov -X search gcov pycov -f coverage.xml | ||
fi | ||
set +x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters