Skip to content

Commit 5d08258

Browse files
committed
ci: use older qemu version
Signed-off-by: Abiola Ibrahim <git@abiosoft.com>
1 parent f19bc79 commit 5d08258

File tree

2 files changed

+89
-4
lines changed

2 files changed

+89
-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: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,22 @@ 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: |
50+
./.github/hack/brew-install-version.sh qemu 8.2.1
4051
brew install --overwrite python@3.12 kubectl docker coreutils lima
4152
4253
- name: Build and Install
@@ -63,7 +74,6 @@ jobs:
6374

6475
kubernetes-containerd:
6576
runs-on: macos-13
66-
needs: kubernetes-docker
6777
steps:
6878
- uses: actions/checkout@v4
6979

@@ -72,11 +82,22 @@ jobs:
7282
with:
7383
go-version: "1.23"
7484

85+
- name: Fetch homebrew-core commit messages
86+
uses: actions/checkout@v4
87+
with:
88+
# needed by ./hack/brew-install-version.sh
89+
repository: homebrew/homebrew-core
90+
path: homebrew-core
91+
fetch-depth: 0
92+
filter: tree:0
93+
7594
- name: Install CLI deps
7695
env:
7796
HOMEBREW_NO_AUTO_UPDATE: "1"
97+
HOMEBREW_NO_INSTALL_UPGRADE: "1"
7898
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
7999
run: |
100+
./.github/hack/brew-install-version.sh qemu 8.2.1
80101
brew install --overwrite python@3.12 kubectl docker coreutils lima
81102
82103
- name: Build and Install
@@ -103,7 +124,6 @@ jobs:
103124

104125
docker:
105126
runs-on: macos-13
106-
needs: kubernetes-containerd
107127
steps:
108128
- uses: actions/checkout@v4
109129

@@ -112,11 +132,22 @@ jobs:
112132
with:
113133
go-version: "1.23"
114134

135+
- name: Fetch homebrew-core commit messages
136+
uses: actions/checkout@v4
137+
with:
138+
# needed by ./hack/brew-install-version.sh
139+
repository: homebrew/homebrew-core
140+
path: homebrew-core
141+
fetch-depth: 0
142+
filter: tree:0
143+
115144
- name: Install CLI deps
116145
env:
117146
HOMEBREW_NO_AUTO_UPDATE: "1"
147+
HOMEBREW_NO_INSTALL_UPGRADE: "1"
118148
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
119149
run: |
150+
./.github/hack/brew-install-version.sh qemu 8.2.1
120151
brew install --overwrite python@3.12 kubectl docker coreutils lima
121152
122153
- name: Build and Install
@@ -152,7 +183,6 @@ jobs:
152183

153184
containerd:
154185
runs-on: macos-13
155-
needs: docker
156186
steps:
157187
- uses: actions/checkout@v4
158188

@@ -161,11 +191,22 @@ jobs:
161191
with:
162192
go-version: "1.23"
163193

194+
- name: Fetch homebrew-core commit messages
195+
uses: actions/checkout@v4
196+
with:
197+
# needed by ./hack/brew-install-version.sh
198+
repository: homebrew/homebrew-core
199+
path: homebrew-core
200+
fetch-depth: 0
201+
filter: tree:0
202+
164203
- name: Install CLI deps
165204
env:
166205
HOMEBREW_NO_AUTO_UPDATE: "1"
206+
HOMEBREW_NO_INSTALL_UPGRADE: "1"
167207
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
168208
run: |
209+
./.github/hack/brew-install-version.sh qemu 8.2.1
169210
brew install --overwrite python@3.12 kubectl docker coreutils lima
170211
171212
- name: Build and Install
@@ -201,7 +242,6 @@ jobs:
201242

202243
incus:
203244
runs-on: macos-13
204-
needs: containerd
205245
steps:
206246
- uses: actions/checkout@v4
207247

@@ -210,11 +250,22 @@ jobs:
210250
with:
211251
go-version: "1.23"
212252

253+
- name: Fetch homebrew-core commit messages
254+
uses: actions/checkout@v4
255+
with:
256+
# needed by ./hack/brew-install-version.sh
257+
repository: homebrew/homebrew-core
258+
path: homebrew-core
259+
fetch-depth: 0
260+
filter: tree:0
261+
213262
- name: Install CLI deps
214263
env:
215264
HOMEBREW_NO_AUTO_UPDATE: "1"
265+
HOMEBREW_NO_INSTALL_UPGRADE: "1"
216266
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
217267
run: |
268+
./.github/hack/brew-install-version.sh qemu 8.2.1
218269
brew install --overwrite python@3.12 kubectl docker coreutils lima incus
219270
220271
- name: Build and Install

0 commit comments

Comments
 (0)