-
-
Notifications
You must be signed in to change notification settings - Fork 0
165 lines (152 loc) · 6.01 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
---
name: ci
"on":
pull_request:
branches:
- master
- main
- develop
push:
branches:
- master
- main
- develop
env:
debug_ci: false
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-12, macos-13, macos-14]
steps:
# Now handled by Homebrew/actions/setup-homebrew
# See: https://github.com/Homebrew/actions/blob/master/setup-homebrew/main.sh#L207-L242
# - name: Check out code
# uses: actions/checkout@v4
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Add SSH_AUTH_SOCK to user shell .profile
run: |
sudo tee -a ~/.profile <<EOPROFILE
SSH_AUTH_SOCK=${{ env.SSH_AUTH_SOCK }}
EOPROFILE
- name: Configure global git SSH URLs
run: |
git config --global url."[email protected]:".insteadOf "https://github.com/"
- name: Set BREWFILE_PATH env var
run: |
echo "BREWFILE_PATH=${GITHUB_WORKSPACE}/Brewfile.ci" >> "$GITHUB_ENV"
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Check out Pull Request
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: DEBUG Tap Repo
run: |
echo HOMEBREW_TAP_REPOSITORY=${{ steps.set-up-homebrew.outputs.repository-path }}
ls -l ${{ steps.set-up-homebrew.outputs.repository-path }}
cd ${{ steps.set-up-homebrew.outputs.repository-path }} && git status && git log --graph --decorate --oneline --all --abbrev-commit
if: ${{ env.debug_ci == 'true' }}
- name: Cache Homebrew Bundler RubyGems
id: cache
uses: actions/cache@v4
with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-rubygems-
- name: Cache style cache
if: runner.os == 'macOS'
uses: actions/cache@v4
with:
path: ~/Library/Caches/Homebrew/style
key: macos-style-cache-${{ github.sha }}
restore-keys: macos-style-cache-
- name: Cache local Tap Casks
if: runner.os == 'macOS'
uses: actions/cache@v4
with:
path: |
~/Library/Caches/Homebrew/Cask/[email protected]*
~/Library/Caches/Homebrew/downloads/*--com.vmware.fusion.zip.tar*
~/Library/Caches/Homebrew/downloads/*--machine-*.tar.gz*
key: brew-${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/clear_github_actions_cache') }}-${{ hashFiles( env.BREWFILE_PATH, '**/Brewfile.lock.json') }}-${{ hashFiles('Casks/**.rb') }}
restore-keys: |
brew-${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/clear_github_actions_cache') }}-${{ hashFiles( env.BREWFILE_PATH, '**/Brewfile.lock.json') }}-${{ hashFiles('Casks/**.rb') }}
brew-${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/clear_github_actions_cache') }}-${{ hashFiles( env.BREWFILE_PATH, '**/Brewfile.lock.json') }}
brew-${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/clear_github_actions_cache') }}
# Note: Disabling this b/c size is over 3 GiB now!
# So, cache was actually slowing down the CI run
# - name: Configure Homebrew cache
# uses: actions/cache@v4
# with:
# path: |
# ~/Library/Caches/Homebrew/*--*
# ~/Library/Caches/Homebrew/downloads/*--*
# ~/Library/Caches/Homebrew/Cask/*--*
# key: brew-${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/clear_github_actions_cache') }}-${{ hashFiles( env.BREWFILE_PATH, '**/Brewfile.lock.json') }}
# restore-keys: |
# brew-${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/clear_github_actions_cache') }}-${{ hashFiles( env.BREWFILE_PATH, '**/Brewfile.lock.json') }}
# brew-${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/clear_github_actions_cache') }}
- name: Run brew update
env:
HOMEBREW_COLOR: 1
HOMEBREW_DEVELOPER: 1
run: |
brew update-reset
- name: Clean homebrew cache
env:
HOMEBREW_COLOR: 1
HOMEBREW_DEVELOPER: 1
run: |
brew cleanup
- name: HACK - Force link conflicting go binaries
env:
HOMEBREW_COLOR: 1
HOMEBREW_DEVELOPER: 1
run: |
if [ -e "/usr/local/opt/[email protected]" ]; then
brew install go || true
brew link --overwrite go
fi
:
- name: Install Brewfile.ci dependencies
env:
HOMEBREW_COLOR: 1
HOMEBREW_DEVELOPER: 1
run: |
brew bundle install --file="${BREWFILE_PATH}"
- name: DEBUG - GitHub Workspace
run: |
echo GITHUB_WORKSPACE="$GITHUB_WORKSPACE"
if: ${{ env.debug_ci == 'true' }}
- name: DEBUG - Print all shell env exports
run: export -p
if: ${{ env.debug_ci == 'true' }}
- name: DEBUG - List workspace and Homebrew contents
run: |
ls -lR "${GITHUB_WORKSPACE}"
ls -lR /usr/local/Homebrew
if: ${{ env.debug_ci == 'true' }}
- name: Run tap install
env:
HOMEBREW_COLOR: 1
HOMEBREW_DEVELOPER: 1
HOMEBREW_NO_SORBET_RUNTIME: 1
run: make install
- name: Run test & install
env:
HOMEBREW_COLOR: 1
HOMEBREW_DEVELOPER: 1
run: |
make test
- name: Upload install.log on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: Build failure logs
path: /var/log/install.log