-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
.travis.yml.old
240 lines (240 loc) · 11.4 KB
/
.travis.yml.old
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
language: objective-c
os: osx
# xcode11.2 for macOS 10.14
# [Building an Objective-C Project - Travis CI](https://docs.travis-ci.com/user/languages/objective-c/)
osx_image: xcode12.2
# Python version is not available for OSX
# [Python runtime is not yet available on OS X · Issue #2312 · travis-ci/travis-ci](https://github.com/travis-ci/travis-ci/issues/2312)
#language: python
#python:
# - "2.7"
# - "3.5"
branches:
except:
- /^v[0-9]/
env:
global:
- GIT_COMMITTER_NAME=rcmdnk
- GIT_AUTHOR_NAME=rcmdnk
- PAGER=cat
- EDITOR=cat # for brew-file edit test
- VISUAL=cat
- coveralls=coveralls-python
#- coveralls=python-coveralls
- CONFIGDIR="$HOME/.config/brewfile"
matrix:
- PYTHON_VERSION="python3"
before_install:
- echo $TRAVIS_PULL_REQUEST
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ];then echo pull request test; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ];then openssl aes-256-cbc -K $encrypted_63171a4b9582_key -iv $encrypted_63171a4b9582_iv -in test/.travis_rsa.tar.enc -out .travis_rsa.tar -d; tar xvf .travis_rsa.tar; mv .travis_rsa_python .travis_rsa_python2; cp .travis_rsa_$PYTHON_VERSION ~/.ssh/id_rsa; chmod 600 ~/.ssh/id_rsa; echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config; fi'
- sw_vers
- brew --version
- brew update
- brew --version
install:
- git config --global user.email "$GIT_AUTHOR_EMAIL"
- git config --global user.name "$GIT_AUTHOR_NAME"
- testaccount=rcmdnk
- testreponame=BrewfileTest_$PYTHON_VERSION
- testrepo=$testaccount/$testreponame
- testrepodir=${testaccount}_${testreponame}
- testrepofulldir=$CONFIGDIR/$testrepodir
- testfile=$testrepofulldir/Brewfile
- brew list --formula > brewlist.orig
- brew install rcmdnk/file/brew-file
- cd ../
- echo $TRAVIS_PULL_REQUEST
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ];then echo TRAVIS_PULL_REQUEST test; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ];then git clone [email protected]:$testrepo;else git clone https://github.com/$testrepo; fi'
- cd $testreponame
- cp ../homebrew-file/test/BrewfileTest ./Brewfile
- cp ../homebrew-file/test/BrewfileExt ./BrewfileExt
- cp ../homebrew-file/test/BrewfileHome ~/BrewfileHome
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ];then git add -A && git commit -a -m "init" && git push -f || echo nothing to be done; fi'
- cd ../homebrew-file
- rm -rf ../$testrepo
- which python
- python --version
- 'brew rm --ignore-dependencies mercurial || :'
- 'brew rm --ignore-dependencies python || :'
- 'brew rm --ignore-dependencies python2 || :'
- 'rm -rf /usr/local/lib/python2.7/ || :'
- 'brew install $PYTHON_VERSION || :'
- hash -r
- 'brew upgrade $PYTHON_VERSION || :'
- export PATH="$(brew --prefix)/opt/$PYTHON_VERSION/libexec/bin:$PATH"
- '[ "$PYTHON_VERSION" = "python2" ] && pip install virtualenv|| :'
- '[ "$PYTHON_VERSION" = "python2" ] && virtualenv -p python py_env|| :'
- '[ "$PYTHON_VERSION" = "python3" ] && python -m venv py_env|| :'
- source py_env/bin/activate
- python --version
- which python
- which pip
- type pip
- pip install --upgrade pip
- '[ "$coveralls" = "coveralls-python" ] && pip install coveralls || :'
- '[ "$coveralls" = "python-coveralls" ] && pip -e . --use-mirrors || :'
- which ruby
- brew install ruby
- hash -r
- which ruby
- 'brew rm postgis || :'
- 'brew rm gdal || :'
- 'brew rm numpy || :'
- 'brew rm maven || :'
- 'brew rm carthage || :'
- 'brew rm java || :'
- rm -rf /usr/local/Caskroom/java/
before_script:
- installed_brew=$(which brew-file)
- brewprefix=$(brew --prefix)
- brewfile=$CONFIGDIR/Brewfile
- exe=$(pwd)/bin/brew-file
- git config --global push.default simple # to suppress git warning
script:
# Sanity checks
- coverage run --parallel-mode $exe version
- coverage run --parallel-mode $exe help
- coverage run --parallel-mode $exe commands
- 'coverage run --parallel-mode $exe || :'
- coverage run --parallel-mode $exe brew list --formula >/dev/null
- mkdir -p $(dirname "$brewfile")
- touch "$brewfile"
- brew list --formula
- coverage run --parallel-mode $exe init -y
- coverage run --parallel-mode $exe cat
- coverage run --parallel-mode $exe update -y -V 2 # better to use verbose mode, because the update takes so long time that travis will end up with no output error if no output is written out at update...
- HOMEBREW_BREWFILE_APPSTORE=true coverage run --parallel-mode $exe test -V 2
- rm $brewfile
- coverage run --parallel-mode $exe update -C -y
- coverage run --parallel-mode $exe init -f ~/mkdirtest/Brewfile -r git://github.com/$testrepo -y
- echo 'file ~/$HOSTNAME/$V1${V2}$V3${V4}/$V5.$V6.test' > BrewfileEnv
- 'test "$(echo $(V1=X1 V2=X2 V5=X5 V6=X6 coverage run --parallel-mode $exe -f BrewfileEnv get_files|tr "\n" " "))" = "BrewfileEnv $HOME/$HOSTNAME/X1X2/X5.X6.test"'
# brew command checks
- coverage run --parallel-mode $exe brew help
- coverage run --parallel-mode $exe brew noinit list --formula
- coverage run --parallel-mode $exe brew info bash
# - coverage run --parallel-mode $exe brew install wget --HEAD --with-iri
- coverage run --parallel-mode $exe -i -y -V 0
# - coverage run --parallel-mode $exe brew uninstall wget
- coverage run --parallel-mode $exe brew tap rcmdnk/mytest
- coverage run --parallel-mode $exe brew tap rcmdnk/mytest
- coverage run --parallel-mode $exe brew install mytest2
- coverage run --parallel-mode $exe brew install mytest2
- coverage run --parallel-mode $exe brew rm mytest2
- coverage run --parallel-mode $exe brew untap rcmdnk/mytest
- coverage run --parallel-mode $exe brew install rcmdnk/mytest/mytest2
- coverage run --parallel-mode $exe brew install rcmdnk/mytest/mytest2
- coverage run --parallel-mode $exe brew tap rcmdnk/mytest
- coverage run --parallel-mode $exe brew rm mytest2
- cat $brewfile |grep -v mytest > ${brewfile}.tmp
- mv ${brewfile}{.tmp,}
- coverage run --parallel-mode $exe brew untap rcmdnk/mytest
- coverage run --parallel-mode $exe brew install rcmdnk/mytest/mytest2 --HEAD
- 'coverage run --parallel-mode $exe brew untap rcmdnk/notexist || :'
- coverage run --parallel-mode $exe brew install appcleaner
- coverage run --parallel-mode $exe brew install appcleaner
- coverage run --parallel-mode $exe brew rm appcleaner
- command brew install appcleaner
- coverage run --parallel-mode $exe brew rm appcleaner
- coverage run --parallel-mode $exe brew list --formula
- 'coverage run --parallel-mode $exe brew wrong_cmd -V 0|| :'
# Cask tests
- coverage run --parallel-mode $exe brew install firefox
- coverage run --parallel-mode $exe brew install macvim # Application installed by brew command, instead of cask
- coverage run --parallel-mode $exe brew list --formula
- coverage run --parallel-mode $exe edit
- coverage run --parallel-mode $exe casklist -V 2
# Wrong file/command tests
- 'coverage run --parallel-mode $exe -f BrewfileWrong pull -y -V 2 || :'
- 'coverage run --parallel-mode $exe -f BrewfileWrong --no_appstore install -y -V 0 || :'
- 'coverage run --parallel-mode $exe wrongcommand || :'
# Wrong command test (test proc)
- echo 'ls wrong_file' > $brewfile
- 'coverage run --parallel-mode $exe install --no_appstore || :'
# Use test repository
- coverage run --parallel-mode $exe set_repo -r git://github.com/$testrepo -b ~/backup.brewfile -y -V 2
- rm -rf $brewfile $testrepofulldir
- echo $TRAVIS_PULL_REQUEST
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ];then coverage run --parallel-mode $exe set_repo -r [email protected]:$testrepo -y -V 2; fi'
- rm -rf $brewfile $testrepofulldir
- coverage run --parallel-mode $exe set_repo -r https://github.com/$testrepo -y -V 2
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ];then rm -rf $brewfile $testrepofulldir; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ];then coverage run --parallel-mode $exe init -r $testrepo -y -V 2; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ];then rm -rf $brewfile $testrepofulldir; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ];then coverage run --parallel-mode $exe set_repo -r $testrepo -y -V 2; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ];then coverage run --parallel-mode $exe set_repo -r $testrepo -y -V 2; fi'
- coverage run --parallel-mode $exe get_files
- coverage run --parallel-mode $exe edit
- cp $testfile .
- coverage run --parallel-mode $exe brew tap rcmdnk/mytest
- HOMEBREW_BREWFILE_APPSTORE=0 coverage run --parallel-mode $exe install -V 2
- coverage run --parallel-mode $exe casklist -V 0
- command brew rm cmake
- coverage run --parallel-mode $exe init -y -V 0
- echo $TRAVIS_PULL_REQUEST
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ];then coverage run --parallel-mode $exe update -y; fi'
# - coverage run --parallel-mode $exe brew rm wget
- command brew install google-chrome
- coverage run --parallel-mode $exe casklist -V 2
- cp Brewfile $testfile
- coverage run --parallel-mode $exe brew tap rcmdnk/rcmdnkcask
- coverage run --parallel-mode $exe brew untap rcmdnk/rcmdnkcask
- coverage run --parallel-mode $exe casklist -V 2
- coverage run --parallel-mode $exe brew tap rcmdnk/rcmdnkcask
# brewdler format tests
- coverage run --parallel-mode $exe init -F brewdler -y -V 2
- coverage run --parallel-mode $exe install --no_appstore -F brewdler
- echo "appstore 'KeyNotes'" >> $testfile
- echo "file 'BrewfileExt'" >> $testfile
- coverage run --parallel-mode $exe -F brewdler brew uninstall google-chrome
- cat "$testrepofulldir/Brewfile"
# command format tests
- coverage run --parallel-mode $exe init -F command -y -V 2
- coverage run --parallel-mode $exe install --no_appstore -F command
# Clean up tests
- 'coverage run --parallel-mode $exe brew rm macvim || :' # to avoid dependencies check
- echo "brew brew-file" > $testfile
- '[ "$PYTHON_VERSION" != "python3" ] && echo brew python >> $testfile || echo brew python3 >> $testfile'
- echo "file BrewfileExt" >> $testfile
- echo "brew bash" >> $testfile
- while read p;do echo "brew $p" >> $testfile;done < brewlist.orig
- coverage run --parallel-mode $exe clean
- coverage run --parallel-mode $exe brew list --formula
- $exe get_files
- cat $($exe get_files)
- brew list --formula
- coverage run --parallel-mode $exe clean -C -V 2
- coverage run --parallel-mode $exe init -y -V 2
- coverage run --parallel-mode $exe brew install Homebrew/cask/firefox
- coverage run --parallel-mode $exe clean -C
# Wrong command test
- echo "wrong command" > $testfile
- 'coverage run --parallel-mode $exe install --no_appstore | :'
# Push current Brewfile in homebrew-file to BrewfileTest
- cp Brewfile $testfile
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ];then coverage run --parallel-mode $exe push -V 0; fi'
# Test with brew-wrap
- source $(brew --prefix)/etc/brew-wrap
- type brew
- brew list --formula
- brew install hub
- brew noinit install stow
# send coverage result to coveralls
- '[ "$PYTHON_VERSION" = "python" ] && coverage combine|| :'
- '[ "$PYTHON_VERSION" = "python" ] && coveralls || :'
# Install test
#- rm -rf $brewprefix/bin/brew $HOME/.brewfile $brewprefix/Cellar
#- rm -rf $brewprefix/.git*
#- curl -fsSL https://raw.github.com/rcmdnk/homebrew-file/install/install.sh |sh >&/dev/null
#- brew help
#- brew file help
notifications:
email:
recipients:
on_success: change
on_failure: always