Skip to content

Commit

Permalink
Cache brew and the things it installs
Browse files Browse the repository at this point in the history
(cherry picked from commit 85253dd)
  • Loading branch information
chreekat authored and mergify[bot] committed Mar 9, 2023
1 parent eb0b028 commit 4e7f673
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ build-aarch64-darwin:
expire_in: 2 week
paths:
- out/*
cache:
paths:
- .brew

build-x86_64-windows:
extends: .build
Expand Down
9 changes: 5 additions & 4 deletions .gitlab/brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ set -Eeuo pipefail
# FIXME: Use brew in supported way. See
# https://docs.brew.sh/Installation#untar-anywhere-unsupported
brew_dir="${CI_PROJECT_DIR}/.brew"
# Temporarily? ensure there's no caching accidentally happening.
rm -fr "${brew_dir}"
mkdir -p "${brew_dir}"
curl -L "https://github.com/Homebrew/brew/archive/refs/tags/${BREW_VERSION}.tar.gz" | tar xz --strip 1 -C "${brew_dir}"

if [ ! -e "${brew_dir}" ]; then
mkdir -p "${brew_dir}"
curl -L "https://github.com/Homebrew/brew/archive/refs/tags/${BREW_VERSION}.tar.gz" | tar xz --strip 1 -C "${brew_dir}"
fi

export PATH="${brew_dir}/bin:${brew_dir}/sbin:$PATH"

Expand Down

0 comments on commit 4e7f673

Please sign in to comment.