1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-26 14:50:04 +08:00
SpaceVim/.ci/script.sh

77 lines
2.1 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
set -ex
2019-01-28 22:12:37 +08:00
export TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST}
if [ "$LINT" = "vimlint" ]; then
2018-08-18 16:41:50 +08:00
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
2018-08-18 16:41:50 +08:00
if [[ -f build_log ]]; then
rm build_log
fi
for file in $(git diff --name-only HEAD master | grep .vim$);
do
/tmp/vimlint/bin/vimlint.sh -E -l /tmp/vimlint -p /tmp/vimlparser $file >> build_log 2>&1;
done
if [[ -s build_log ]]; then
cat build_log
exit 2
fi
2019-07-18 22:36:59 +08:00
elif [ "$LINT" = "file-encoding" ]; then
if [[ -f encoding_log ]]; then
rm encoding_log
fi
for file in $(git diff --name-only HEAD master | grep .);
do
encoding=`file -bi $file | cut -f 2 -d";" | cut -f 2 -d=`
2019-07-23 21:24:13 +08:00
case $encoding in
utf-8)
exit 0
;;
us-ascii)
exit 0
;;
cp936)
echo $file >> encoding_log
exit 2
;;
cp835)
echo $file >> encoding_log
exit 2
esac
echo $file >> encoding_log
exit 2
2019-07-18 22:36:59 +08:00
done
if [[ -s encoding_log ]]; then
cat encoding_log
exit 2
fi
elif [ "$LINT" = "vint" ]; then
2018-08-18 16:41:50 +08:00
vint .
elif [ "$LINT" = "vint-errors" ]; then
2018-08-18 16:41:50 +08:00
vint --error .
elif [ "$LINT" = "vader" ]; then
2019-10-09 22:57:03 +08:00
if [ "$VIM_BIN" = "nvim" ]; then
export PATH="${DEPS}/_neovim/${VIM_TAG}/bin:${PATH}"
export VIM="${DEPS}/_neovim/${VIM_TAG}/share/nvim/runtime"
else
export PATH="${DEPS}/_vim/${VIM_TAG}/bin:${PATH}"
export VIM="${DEPS}/_vim/${VIM_TAG}/share/vim"
fi
2018-08-18 16:41:50 +08:00
2019-10-09 22:57:03 +08:00
echo "\$PATH: \"${PATH}\""
2018-08-18 16:41:50 +08:00
echo "\$VIM: \"${VIM}\""
2019-10-09 22:57:03 +08:00
echo "================= ${VIM_BIN} version ======================"
$VIM_BIN --version
2018-08-18 16:41:50 +08:00
pip install covimerage
make test_coverage
covimerage -vv xml --omit 'build/*'
pip install codecov
codecov -X search gcov pycov -f coverage.xml
2018-01-20 22:40:48 +08:00
elif [ "$LINT" = "jekyll" ]; then
2018-08-18 16:41:50 +08:00
.ci/build-production
fi
set +x