-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.travis.yml
148 lines (143 loc) · 5.39 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
language: generic
git:
depth: 10
env:
global:
- THEMIS_VERSION=v1.5.4
cache:
directories:
- &cache_dir $HOME/cache
before_install:
- mkdir -p ${HOME}/cache
- '[[ -d ${HOME}/cache/themis-${THEMIS_VERSION} ]] || git clone --depth 1 --branch ${THEMIS_VERSION} --single-branch https://github.com/thinca/vim-themis ${HOME}/cache/themis-${THEMIS_VERSION}'
anchors:
linux: &linux
os: linux
dist: xenial
install:
- docker pull "thinca/vim:${VIM_VERSION}"
script:
- docker run --rm -it "thinca/vim:${VIM_VERSION}" --version
- docker run --rm -it -v "${PWD}:/root" -v "${HOME}/cache/themis-${THEMIS_VERSION}:/tmp/themis" --entrypoint /tmp/themis/bin/themis "thinca/vim:${VIM_VERSION}" --reporter dot
osx: &osx
os: osx
install:
- |
if [[ ${VIM_VERSION} = 'latest' ]]; then
VIM_URL=$(curl -s --retry 3 'https://vim-jp.org/redirects/macvim-dev/macvim/latest.json' | sed 's@.*"redirect_url":"\([^"]*\)".*@\1@')
if [[ -z "${VIM_URL}" ]]; then
echo "Can't get Vim's URL" >&2
exit 64
fi
VIM_VERSION=$(echo ${VIM_URL} | sed 's@.*/download/\([^/]*\).*@\1@')
if [[ -z "${VIM_VERSION}" ]]; then
echo "Can't detect Vim's version from URL(${VIM_URL})" >&2
exit 65
fi
fi
- |
if [[ ! -d "${HOME}/cache/macvim-${VIM_VERSION}" ]]; then
echo "Download from ${VIM_URL}"
curl --silent --location --output "/tmp/MacVim.dmg" "${VIM_URL}"
hdiutil attach -quiet -mountpoint "/Volumes/MacVim" "/tmp/MacVim.dmg"
mkdir -p "${HOME}/cache/macvim-${VIM_VERSION}"
cp -r "/Volumes/MacVim/MacVim.app" "${HOME}/cache/macvim-${VIM_VERSION}"
hdiutil detach "/Volumes/MacVim"
rm "/tmp/MacVim.dmg"
fi
- |
if [[ -x ""${HOME}/cache/macvim-${VIM_VERSION}/MacVim.app/Contents/bin/vim"" ]]; then
export THEMIS_VIM="${HOME}/cache/macvim-${VIM_VERSION}/MacVim.app/Contents/bin/vim"
elif [[ -x ""${HOME}/cache/macvim-${VIM_VERSION}/MacVim.app/Contents/MacOS/Vim"" ]]; then
export THEMIS_VIM="${HOME}/cache/macvim-${VIM_VERSION}/MacVim.app/Contents/MacOS/Vim"
fi
script:
- ${THEMIS_VIM} --version
- ${HOME}/cache/themis-${THEMIS_VERSION}/bin/themis --reporter dot
windows: &windows
os: windows
language: c # 'generic' is not supported yet on windows
install:
- |
if [[ ${VIM_VERSION} = 'latest' ]]; then
VIM_URL=$(curl -s --retry 3 'https://vim-jp.org/redirects/vim/vim-win32-installer/latest/x64.json' | jq -r '.redirect_url')
if [[ -z "${VIM_URL}" ]]; then
echo "Can't get Vim's URL" >&2
exit 64
fi
VIM_VERSION=$(echo ${VIM_URL} | sed 's@.*/download/\([^/]*\).*@\1@')
if [[ -z "${VIM_VERSION}" ]]; then
echo "Can't detect Vim's version from URL(${VIM_URL})" >&2
exit 65
fi
fi
- |
if [[ ! -d ${HOME}/cache/vim-${VIM_VERSION} ]]; then
if [[ -z "${VIM_URL}" ]]; then
if [[ "${VIM_VERSION}" =~ "v7" ]]; then
VIM_URL=https://ftp.nluug.nl/pub/vim/pc/vim$(echo ${VIM_VERSION} | sed 's/[^0-9]//g')w32.zip
else
VIM_URL=https://github.com/vim/vim-win32-installer/releases/download/${VIM_VERSION}/gvim_$(echo ${VIM_VERSION} | sed 's/v//')_x64.zip
fi
fi
echo "Download from ${VIM_URL}"
curl --silent --location --output "${HOME}/cache/vim-${VIM_VERSION}.zip" "${VIM_URL}"
7z x "-o${HOME}/cache/vim-${VIM_VERSION}" "${HOME}/cache/vim-${VIM_VERSION}.zip"
rm "${HOME}/cache/vim-${VIM_VERSION}.zip"
fi
- export THEMIS_VIM=$(echo ${HOME}/cache/vim-${VIM_VERSION}/vim/*/vim.exe)
script:
- ${THEMIS_VIM} --version
- ${HOME}/cache/themis-${THEMIS_VERSION}/bin/themis.bat --reporter dot
jobs:
include:
- <<: *linux
env: VIM_VERSION=v7.4
- <<: *linux
env: VIM_VERSION=v8.0.0000
- <<: *linux
env: VIM_VERSION=v8.1.0005
- <<: *linux
env: VIM_VERSION=latest
- <<: *osx
env:
- VIM_VERSION=v7.4.903
- VIM_URL=https://github.com/macvim-dev/macvim/releases/download/snapshot-79/MacVim-7.4.dmg
- <<: *osx
env:
- VIM_VERSION=v8.0.0003
- VIM_URL=https://github.com/macvim-dev/macvim/releases/download/snapshot-110/MacVim.dmg
- <<: *osx
env:
- VIM_VERSION=v8.1.0039
- VIM_URL=https://github.com/macvim-dev/macvim/releases/download/snapshot-148/MacVim.dmg
- <<: *osx
env: VIM_VERSION=latest
- <<: *windows
env: VIM_VERSION=v7.3
- <<: *windows
env: VIM_VERSION=v7.4
- <<: *windows
env: VIM_VERSION=v8.0.0003
- <<: *windows
env: VIM_VERSION=v8.1.0001
- <<: *windows
env: VIM_VERSION=latest
- name: Lint
if: type = pull_request
os: linux
dist: xenial
language: python
python: 3.7
env:
- REVIEWDOG_VERSION=v0.9.12
- VINT_VERSION=0.4a1
cache:
pip: true
directories:
- *cache_dir
install:
- '[[ -x ~/cache/reviewdog ]] || curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b ~/cache ${REVIEWDOG_VERSION}'
- pip install vim-vint=="${VINT_VERSION}"
script:
- ~/cache/reviewdog -reporter=github-pr-check