Skip to content

Commit 17df1e4

Browse files
authored
ci: use older qemu version (#1160)
* ci: use older qemu version Signed-off-by: Abiola Ibrahim <git@abiosoft.com> * ci: fix order of qemu installation Signed-off-by: Abiola Ibrahim <git@abiosoft.com> * ci: fix removal of qemu Signed-off-by: Abiola Ibrahim <git@abiosoft.com> --------- Signed-off-by: Abiola Ibrahim <git@abiosoft.com>
1 parent f19bc79 commit 17df1e4

File tree

2 files changed

+94
-4
lines changed

2 files changed

+94
-4
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
# This script only works for formulas in the homebrew-core.
3+
# It assumes the homebrew-core has been checked out into ./homebrew-core.
4+
# It only needs commit messages, so the checkout can be filtered with tree:0.
5+
6+
set -eu -o pipefail
7+
8+
FORMULA=$1
9+
VERSION=$2
10+
11+
export HOMEBREW_NO_AUTO_UPDATE=1
12+
export HOMEBREW_NO_INSTALL_UPGRADE=1
13+
export HOMEBREW_NO_INSTALL_CLEANUP=1
14+
15+
TAP=lima/tap
16+
if ! brew tap | grep -q "^${TAP}\$"; then
17+
brew tap-new "$TAP"
18+
fi
19+
20+
# Get the latest commit id for the commit that updated this bottle
21+
SHA=$(git -C homebrew-core log --max-count 1 --grep "^${FORMULA}: update ${VERSION} bottle" --format="%H")
22+
if [[ -z $SHA ]]; then
23+
echo "${FORMULA} ${VERSION} not found"
24+
exit 1
25+
fi
26+
27+
OUTPUT="$(brew --repo "$TAP")/Formula/${FORMULA}.rb"
28+
RAW="https://raw.githubusercontent.com/Homebrew/homebrew-core"
29+
curl -s "${RAW}/${SHA}/Formula/${FORMULA::1}/${FORMULA}.rb" -o "$OUTPUT"
30+
31+
if brew ls -1 | grep -q "^${FORMULA}\$"; then
32+
brew uninstall "$FORMULA" --ignore-dependencies
33+
fi
34+
brew install "${TAP}/${FORMULA}"

.github/workflows/integration.yml

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,24 @@ jobs:
3232
with:
3333
go-version: "1.23"
3434

35+
- name: Fetch homebrew-core commit messages
36+
uses: actions/checkout@v4
37+
with:
38+
# needed by ./hack/brew-install-version.sh
39+
repository: homebrew/homebrew-core
40+
path: homebrew-core
41+
fetch-depth: 0
42+
filter: tree:0
43+
3544
- name: Install CLI deps
3645
env:
3746
HOMEBREW_NO_AUTO_UPDATE: "1"
47+
HOMEBREW_NO_INSTALL_UPGRADE: "1"
3848
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
3949
run: |
4050
brew install --overwrite python@3.12 kubectl docker coreutils lima
51+
brew uninstall --ignore-dependencies qemu
52+
./.github/hack/brew-install-version.sh qemu 8.2.1
4153
4254
- name: Build and Install
4355
run: make && sudo make install
@@ -63,7 +75,6 @@ jobs:
6375

6476
kubernetes-containerd:
6577
runs-on: macos-13
66-
needs: kubernetes-docker
6778
steps:
6879
- uses: actions/checkout@v4
6980

@@ -72,12 +83,24 @@ jobs:
7283
with:
7384
go-version: "1.23"
7485

86+
- name: Fetch homebrew-core commit messages
87+
uses: actions/checkout@v4
88+
with:
89+
# needed by ./hack/brew-install-version.sh
90+
repository: homebrew/homebrew-core
91+
path: homebrew-core
92+
fetch-depth: 0
93+
filter: tree:0
94+
7595
- name: Install CLI deps
7696
env:
7797
HOMEBREW_NO_AUTO_UPDATE: "1"
98+
HOMEBREW_NO_INSTALL_UPGRADE: "1"
7899
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
79100
run: |
80101
brew install --overwrite python@3.12 kubectl docker coreutils lima
102+
brew uninstall --ignore-dependencies qemu
103+
./.github/hack/brew-install-version.sh qemu 8.2.1
81104
82105
- name: Build and Install
83106
run: make && sudo make install
@@ -103,7 +126,6 @@ jobs:
103126

104127
docker:
105128
runs-on: macos-13
106-
needs: kubernetes-containerd
107129
steps:
108130
- uses: actions/checkout@v4
109131

@@ -112,12 +134,24 @@ jobs:
112134
with:
113135
go-version: "1.23"
114136

137+
- name: Fetch homebrew-core commit messages
138+
uses: actions/checkout@v4
139+
with:
140+
# needed by ./hack/brew-install-version.sh
141+
repository: homebrew/homebrew-core
142+
path: homebrew-core
143+
fetch-depth: 0
144+
filter: tree:0
145+
115146
- name: Install CLI deps
116147
env:
117148
HOMEBREW_NO_AUTO_UPDATE: "1"
149+
HOMEBREW_NO_INSTALL_UPGRADE: "1"
118150
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
119151
run: |
120152
brew install --overwrite python@3.12 kubectl docker coreutils lima
153+
brew uninstall --ignore-dependencies qemu
154+
./.github/hack/brew-install-version.sh qemu 8.2.1
121155
122156
- name: Build and Install
123157
run: make && sudo make install
@@ -152,7 +186,6 @@ jobs:
152186

153187
containerd:
154188
runs-on: macos-13
155-
needs: docker
156189
steps:
157190
- uses: actions/checkout@v4
158191

@@ -161,12 +194,24 @@ jobs:
161194
with:
162195
go-version: "1.23"
163196

197+
- name: Fetch homebrew-core commit messages
198+
uses: actions/checkout@v4
199+
with:
200+
# needed by ./hack/brew-install-version.sh
201+
repository: homebrew/homebrew-core
202+
path: homebrew-core
203+
fetch-depth: 0
204+
filter: tree:0
205+
164206
- name: Install CLI deps
165207
env:
166208
HOMEBREW_NO_AUTO_UPDATE: "1"
209+
HOMEBREW_NO_INSTALL_UPGRADE: "1"
167210
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
168211
run: |
169212
brew install --overwrite python@3.12 kubectl docker coreutils lima
213+
brew uninstall --ignore-dependencies qemu
214+
./.github/hack/brew-install-version.sh qemu 8.2.1
170215
171216
- name: Build and Install
172217
run: make && sudo make install
@@ -201,7 +246,6 @@ jobs:
201246

202247
incus:
203248
runs-on: macos-13
204-
needs: containerd
205249
steps:
206250
- uses: actions/checkout@v4
207251

@@ -210,12 +254,24 @@ jobs:
210254
with:
211255
go-version: "1.23"
212256

257+
- name: Fetch homebrew-core commit messages
258+
uses: actions/checkout@v4
259+
with:
260+
# needed by ./hack/brew-install-version.sh
261+
repository: homebrew/homebrew-core
262+
path: homebrew-core
263+
fetch-depth: 0
264+
filter: tree:0
265+
213266
- name: Install CLI deps
214267
env:
215268
HOMEBREW_NO_AUTO_UPDATE: "1"
269+
HOMEBREW_NO_INSTALL_UPGRADE: "1"
216270
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
217271
run: |
218272
brew install --overwrite python@3.12 kubectl docker coreutils lima incus
273+
brew uninstall --ignore-dependencies qemu
274+
./.github/hack/brew-install-version.sh qemu 8.2.1
219275
220276
- name: Build and Install
221277
run: make && sudo make install

0 commit comments

Comments
 (0)