Skip to content

Commit

Permalink
ci: use older qemu version (#1160)
Browse files Browse the repository at this point in the history
* ci: use older qemu version

Signed-off-by: Abiola Ibrahim <[email protected]>

* ci: fix order of qemu installation

Signed-off-by: Abiola Ibrahim <[email protected]>

* ci: fix removal of qemu

Signed-off-by: Abiola Ibrahim <[email protected]>

---------

Signed-off-by: Abiola Ibrahim <[email protected]>
  • Loading branch information
abiosoft authored Oct 9, 2024
1 parent f19bc79 commit 17df1e4
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 4 deletions.
34 changes: 34 additions & 0 deletions .github/hack/brew-install-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
# This script only works for formulas in the homebrew-core.
# It assumes the homebrew-core has been checked out into ./homebrew-core.
# It only needs commit messages, so the checkout can be filtered with tree:0.

set -eu -o pipefail

FORMULA=$1
VERSION=$2

export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_INSTALL_UPGRADE=1
export HOMEBREW_NO_INSTALL_CLEANUP=1

TAP=lima/tap
if ! brew tap | grep -q "^${TAP}\$"; then
brew tap-new "$TAP"
fi

# Get the latest commit id for the commit that updated this bottle
SHA=$(git -C homebrew-core log --max-count 1 --grep "^${FORMULA}: update ${VERSION} bottle" --format="%H")
if [[ -z $SHA ]]; then
echo "${FORMULA} ${VERSION} not found"
exit 1
fi

OUTPUT="$(brew --repo "$TAP")/Formula/${FORMULA}.rb"
RAW="https://raw.githubusercontent.com/Homebrew/homebrew-core"
curl -s "${RAW}/${SHA}/Formula/${FORMULA::1}/${FORMULA}.rb" -o "$OUTPUT"

if brew ls -1 | grep -q "^${FORMULA}\$"; then
brew uninstall "$FORMULA" --ignore-dependencies
fi
brew install "${TAP}/${FORMULA}"
64 changes: 60 additions & 4 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,24 @@ jobs:
with:
go-version: "1.23"

- name: Fetch homebrew-core commit messages
uses: actions/checkout@v4
with:
# needed by ./hack/brew-install-version.sh
repository: homebrew/homebrew-core
path: homebrew-core
fetch-depth: 0
filter: tree:0

- name: Install CLI deps
env:
HOMEBREW_NO_AUTO_UPDATE: "1"
HOMEBREW_NO_INSTALL_UPGRADE: "1"
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
run: |
brew install --overwrite [email protected] kubectl docker coreutils lima
brew uninstall --ignore-dependencies qemu
./.github/hack/brew-install-version.sh qemu 8.2.1
- name: Build and Install
run: make && sudo make install
Expand All @@ -63,7 +75,6 @@ jobs:

kubernetes-containerd:
runs-on: macos-13
needs: kubernetes-docker
steps:
- uses: actions/checkout@v4

Expand All @@ -72,12 +83,24 @@ jobs:
with:
go-version: "1.23"

- name: Fetch homebrew-core commit messages
uses: actions/checkout@v4
with:
# needed by ./hack/brew-install-version.sh
repository: homebrew/homebrew-core
path: homebrew-core
fetch-depth: 0
filter: tree:0

- name: Install CLI deps
env:
HOMEBREW_NO_AUTO_UPDATE: "1"
HOMEBREW_NO_INSTALL_UPGRADE: "1"
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
run: |
brew install --overwrite [email protected] kubectl docker coreutils lima
brew uninstall --ignore-dependencies qemu
./.github/hack/brew-install-version.sh qemu 8.2.1
- name: Build and Install
run: make && sudo make install
Expand All @@ -103,7 +126,6 @@ jobs:

docker:
runs-on: macos-13
needs: kubernetes-containerd
steps:
- uses: actions/checkout@v4

Expand All @@ -112,12 +134,24 @@ jobs:
with:
go-version: "1.23"

- name: Fetch homebrew-core commit messages
uses: actions/checkout@v4
with:
# needed by ./hack/brew-install-version.sh
repository: homebrew/homebrew-core
path: homebrew-core
fetch-depth: 0
filter: tree:0

- name: Install CLI deps
env:
HOMEBREW_NO_AUTO_UPDATE: "1"
HOMEBREW_NO_INSTALL_UPGRADE: "1"
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
run: |
brew install --overwrite [email protected] kubectl docker coreutils lima
brew uninstall --ignore-dependencies qemu
./.github/hack/brew-install-version.sh qemu 8.2.1
- name: Build and Install
run: make && sudo make install
Expand Down Expand Up @@ -152,7 +186,6 @@ jobs:

containerd:
runs-on: macos-13
needs: docker
steps:
- uses: actions/checkout@v4

Expand All @@ -161,12 +194,24 @@ jobs:
with:
go-version: "1.23"

- name: Fetch homebrew-core commit messages
uses: actions/checkout@v4
with:
# needed by ./hack/brew-install-version.sh
repository: homebrew/homebrew-core
path: homebrew-core
fetch-depth: 0
filter: tree:0

- name: Install CLI deps
env:
HOMEBREW_NO_AUTO_UPDATE: "1"
HOMEBREW_NO_INSTALL_UPGRADE: "1"
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
run: |
brew install --overwrite [email protected] kubectl docker coreutils lima
brew uninstall --ignore-dependencies qemu
./.github/hack/brew-install-version.sh qemu 8.2.1
- name: Build and Install
run: make && sudo make install
Expand Down Expand Up @@ -201,7 +246,6 @@ jobs:

incus:
runs-on: macos-13
needs: containerd
steps:
- uses: actions/checkout@v4

Expand All @@ -210,12 +254,24 @@ jobs:
with:
go-version: "1.23"

- name: Fetch homebrew-core commit messages
uses: actions/checkout@v4
with:
# needed by ./hack/brew-install-version.sh
repository: homebrew/homebrew-core
path: homebrew-core
fetch-depth: 0
filter: tree:0

- name: Install CLI deps
env:
HOMEBREW_NO_AUTO_UPDATE: "1"
HOMEBREW_NO_INSTALL_UPGRADE: "1"
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
run: |
brew install --overwrite [email protected] kubectl docker coreutils lima incus
brew uninstall --ignore-dependencies qemu
./.github/hack/brew-install-version.sh qemu 8.2.1
- name: Build and Install
run: make && sudo make install
Expand Down

0 comments on commit 17df1e4

Please sign in to comment.