Skip to content

Commit 4e7f673

Browse files
chreekatmergify[bot]
authored andcommitted
Cache brew and the things it installs
(cherry picked from commit 85253dd)
1 parent eb0b028 commit 4e7f673

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.gitlab-ci.yml

+3
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ build-aarch64-darwin:
100100
expire_in: 2 week
101101
paths:
102102
- out/*
103+
cache:
104+
paths:
105+
- .brew
103106

104107
build-x86_64-windows:
105108
extends: .build

.gitlab/brew.sh

+5-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ set -Eeuo pipefail
66
# FIXME: Use brew in supported way. See
77
# https://docs.brew.sh/Installation#untar-anywhere-unsupported
88
brew_dir="${CI_PROJECT_DIR}/.brew"
9-
# Temporarily? ensure there's no caching accidentally happening.
10-
rm -fr "${brew_dir}"
11-
mkdir -p "${brew_dir}"
12-
curl -L "https://github.com/Homebrew/brew/archive/refs/tags/${BREW_VERSION}.tar.gz" | tar xz --strip 1 -C "${brew_dir}"
9+
10+
if [ ! -e "${brew_dir}" ]; then
11+
mkdir -p "${brew_dir}"
12+
curl -L "https://github.com/Homebrew/brew/archive/refs/tags/${BREW_VERSION}.tar.gz" | tar xz --strip 1 -C "${brew_dir}"
13+
fi
1314

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

0 commit comments

Comments
 (0)