-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
azure-pipelines.yml
169 lines (160 loc) · 6.64 KB
/
azure-pipelines.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
jobs:
- job: Shellcheck
pool:
demands:
- agent.os -equals Darwin
steps:
- bash: |
set -e
set -u
set -o pipefail
brew install shellcheck
shellcheck .sh
displayName: ShellCheck
- job: RuboCop
pool:
demands:
- agent.os -equals Darwin
steps:
- bash: |
set -e
set -u
set -o pipefail
gem install rubocop
rubocop --color
displayName: RuboCop
- job: Dotfiles
timeoutInMinutes: 200
strategy:
matrix:
Catalina:
vmImage: 'macOS-10.15'
pool:
vmImage: $(vmImage)
steps:
- bash: |
set -e
set -u
set -o pipefail
# Uninstall Gems.
for gem in $(gem list --no-versions | grep -v \
-e 'bigdecimal' \
-e 'CFPropertyList' \
-e 'cmath' \
-e 'csv' \
-e 'date' \
-e 'dbm' \
-e 'did_you_mean' \
-e 'e2mmap' \
-e 'etc' \
-e 'fcntl' \
-e 'fiddle' \
-e 'fileutils' \
-e 'forwardable' \
-e 'io-console' \
-e 'ipaddr' \
-e 'irb' \
-e 'json' \
-e 'libxml-ruby' \
-e 'logger' \
-e 'matrix' \
-e 'minitest' \
-e 'mutex_m' \
-e 'net-telnet' \
-e 'nokogiri' \
-e 'openssl' \
-e 'ostruct' \
-e 'power_assert' \
-e 'prime' \
-e 'psych' \
-e 'rake' \
-e 'rexml' \
-e 'rdoc' \
-e 'rss' \
-e 'scanf' \
-e 'shell' \
-e 'sqlite3' \
-e 'stringio' \
-e 'strscan' \
-e 'sync' \
-e 'test-unit' \
-e 'thwait' \
-e 'tracer' \
-e 'webrick' \
-e 'xmlrpc' \
-e 'zlib' \
); do
sudo gem uninstall --force --all --ignore-dependencies --executables "$gem"
done
# Uninstall Homebrew.
sudo rm -rf /usr/local/miniconda &
rm -rf /usr/local/lib/node_modules &
rm -f /usr/local/bin/terminal-notifier
if which brew &>/dev/null; then
eval "$(brew list | xargs -I% echo 'brew uninstall --force --ignore-dependencies "%" &')"
eval "$(brew cask list | xargs -I% echo '{ brew cask uninstall --force "%"; brew cask zap --force "%"; } &')"
brew cask zap --force dotnet &
wait
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" -- --force
fi
# Uninstall Xcode and Command Line Tools
mkdir -p /tmp/trash
for trash in /Applications/Xcode*.app /Library/Developer/CommandLineTools; do
sudo mv "$trash" /tmp/trash/
done
sudo pkgutil --forget com.apple.pkg.CLTools_Executables
sudo xcode-select --reset
# Clean environment.
for trash in ~/.DS_Store \
~/.Trash/* \
~/.android \
~/.azcopy \
~/.azure \
~/.bash_history \
~/.bash_profile \
~/.bash_sessions \
~/.bashrc \
~/.cargo \
~/.cocoapods \
~/.conda \
~/.config \
~/.dotnet \
~/.fastlane \
~/.gem \
~/.gitconfig \
~/.gradle \
~/.m2 \
~/.mono \
~/.npm \
~/.npmrc \
~/.nvm \
~/.oracle_jre_usage \
~/.packer.d \
~/.rustup \
~/.sh_history \
~/.subversion \
~/.sqlite_history \
~/.vcpkg \
~/.viminfo \
~/.wget-hsts \
~/.yarn \
~/Library/Caches/Homebrew \
~/Microsoft \
~/hostedtoolcache \
~/*.txt; do
if [ -e "$trash" ]; then
mv "$trash" /tmp/trash/
fi
done
# Delete broken symlinks.
for exe in /usr/local/bin/*; do
if [ -L "$exe" ] && ! [ -e "$exe" ]; then
rm "$exe"
fi
done
ls -al ~/
displayName: Clean environment
- bash: ./.sh
displayName: Run `.sh`
env:
CI: 'true'