Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unuse self-hosted macOS runner #588

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 2 additions & 49 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,65 +42,18 @@ jobs:
strategy:
fail-fast: false
matrix:
runs-on:
- macos-latest
- ['self-hosted', 'macOS', 'ARM64']
go:
- '1.20'
- '1.21'
runs-on: ${{ matrix.runs-on }}
name: Darwin Go ${{ matrix.go }} ${{ join(matrix.runs-on, ' ') }}
env:
HOMEBREW_CACHE: ${{ github.workspace }}/brew-cache
runs-on: macos-latest
name: Darwin Go ${{ matrix.go }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

# Set up local brew only on self-hosted darwin
- name: Checkout Homebrew
if: matrix.runs-on != 'macos-latest'
uses: actions/checkout@v4
with:
repository: Homebrew/brew
path: homebrew
- name: Local brew cache key
if: matrix.runs-on != 'macos-latest'
id: brew-cache-key
run: echo "key=$(date +'%Y-%U')" | tee ${GITHUB_OUTPUT} # weekly refresh the cache
- name: Cache brew
if: matrix.runs-on != 'macos-latest'
uses: actions/cache@v4
with:
path: ${{ env.HOMEBREW_CACHE }}
key: ${{ runner.os }}-brew-cache-${{ steps.brew-cache-key.outputs.key }}
- name: Cache local brew taps
if: matrix.runs-on != 'macos-latest'
uses: actions/cache@v4
with:
path: homebrew/Library/Taps
key: ${{ runner.os }}-brew-taps-${{ steps.brew-cache-key.outputs.key }}
- name: Set up brew to install deps under temporary dir
if: matrix.runs-on != 'macos-latest'
run: |
dir="${GITHUB_WORKSPACE}/homebrew"
cd "${dir}"

echo "Set up shellenv" >&2
env="$(./bin/brew shellenv)"
echo "${env}" | tee -a ${GITHUB_ENV}
eval "${env}"

echo "Set up paths" >&2
echo "${dir}/bin" | tee -a ${GITHUB_PATH}

echo "Brew update" >&2
brew update --force --quiet
chmod -R go-w "$(brew --prefix)/share/zsh"

- name: Install dependencies
run: |
which brew
Expand Down
Loading