-
-
Notifications
You must be signed in to change notification settings - Fork 4
254 lines (231 loc) · 9.87 KB
/
ci.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
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
name: CI
on: push
concurrency:
group: ${{ github.ref }}
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: lumaxis/shellcheck-problem-matchers@v1
with:
format: gcc
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
env:
SHELLCHECK_OPTS: --format=gcc
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- run: gem install rubocop --no-doc
- run: rubocop --display-cop-names --format progress --format json --out rubocop.json
- uses: duderman/[email protected]
with:
path: rubocop.json
if: ${{ failure() }}
macos:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-13, macos-14]
fail-fast: false
steps:
- name: Uninstall gems
run: |
set -e
set -u
set -o pipefail
for gem in $(/usr/bin/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 /usr/bin/gem uninstall --force --all --ignore-dependencies --executables "$gem"
done
- name: Uninstall Homebrew
run: |
set -e
set -u
set -o pipefail
brew update
sudo rm -rf /usr/local/miniconda &
rm -rf /usr/local/lib/node_modules &
rm -f /usr/local/bin/terminal-notifier
rm -f /usr/local/bin/change_hostname.sh
rm -f /usr/local/bin/azcopy
if which brew &>/dev/null; then
eval "$(brew list --formula | xargs -I% echo 'brew uninstall --formula --force --ignore-dependencies "%" &')"
eval "$(brew list --cask | xargs -I% echo '{ brew uninstall --cask --force "%"; brew uninstall --cask --zap --force "%"; } &')"
brew uninstall --cask --zap --force adoptopenjdk/openjdk/adoptopenjdk8 &
brew uninstall --cask --zap --force dotnet &
brew uninstall --cask --zap --force firefox &
brew uninstall --cask --zap --force julia &
brew uninstall --cask --zap --force mono-mdk &
brew uninstall --cask --zap --force xamarin-android &
brew uninstall --cask --zap --force xamarin-ios &
brew uninstall --cask --zap --force xamarin-mac &
brew uninstall --cask --zap --force visual-studio &
wait
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" -- --force
fi
- name: Uninstall Xcode and Command-Line Tools
run: |
set -e
set -u
set -o pipefail
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
- name: Uninstall leftover packages
run: |
set -e
set -u
set -o pipefail
mkdir -p /tmp/trash
for pkg in /var/db/receipts/*.plist; do
pkg_id="$(basename "${pkg}" .plist)"
volume="$(pkgutil --pkg-info "${pkg_id}" | sed -n -e 's/^volume: //p')"
location="$(pkgutil --pkg-info "${pkg_id}" | sed -n -e 's/^location: //p')"
pkgutil --only-files --files "${pkg_id}" | xargs -I% sudo mv -f "${volume}${location}/%" /tmp/trash/ || true
pkgutil --only-dirs --files "${pkg_id}" | xargs -I% sudo rmdir -p "${volume}${location}/%" || true
pkgutil --forget "${pkg_id}"
done
- name: Delete broken symlinks
run: |
set -e
set -u
set -o pipefail
for exe in /usr/local/bin/*; do
if [[ -L "$exe" ]] && ! [[ -e "$exe" ]]; then
rm "$exe"
fi
done
- name: Delete leftover applications
run: |
set -e
set -u
set -o pipefail
sudo rm -rf '/Applications/Google Chrome for Testing.app' &
sudo rm -rf '/Applications/Python 2.7' &
sudo rm -rf '/Applications/Python 3.11' &
sudo rm -rf '/Applications/Visual Studio 2019.app' &
wait
ls -al /Applications /Applications/Utilities
- name: Clean user directory
run: |
set -e
set -u
set -o pipefail
for trash in ~/.DS_Store \
~/.Trash/* \
~/.aliyun \
~/.android \
~/.azcopy \
~/.azure \
~/.bash_history \
~/.bash_profile \
~/.bash_sessions \
~/.bashrc \
~/.cabal \
~/.cache \
~/.cargo \
~/.cocoapods \
~/.composer \
~/.conda \
~/.config \
~/.dotnet \
~/.fastlane \
~/.gem \
~/.ghcup \
~/.gitconfig \
~/.gradle \
~/.local \
~/.m2 \
~/.mono \
~/.npm \
~/.npmrc \
~/.nvm \
~/.oracle_jre_usage \
~/.packer.d \
~/.rustup \
~/.sh_history \
~/.ssh \
~/.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
- name: Check installed apps
run: |
ls -al /Applications
ls -al /Applications/Utilities
ls -al ~/
- name: Install dotfiles via `curl`
run: |
curl -sL git.io/.sh | sh
linux:
runs-on: ubuntu-latest
steps:
- name: Check out dotfiles
uses: actions/checkout@v3
- name: Install dotfiles
run: |
./setup.sh