Skip to content

Commit

Permalink
Unuse self-hosted macOS runner (#588)
Browse files Browse the repository at this point in the history
GitHub-hosted macos runner is M1 by default now.
  • Loading branch information
at-wat authored Oct 23, 2024
1 parent bc0b11e commit 9ea1754
Showing 1 changed file with 2 additions and 49 deletions.
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

0 comments on commit 9ea1754

Please sign in to comment.