From 626dbea0376cbc9679871cafc2388371ae20c505 Mon Sep 17 00:00:00 2001 From: Atsushi Watanabe Date: Tue, 22 Oct 2024 17:54:18 +0900 Subject: [PATCH 1/2] Isolate local homebrew cache directory --- .github/workflows/ci.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ec1df90e..8774a4fb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -50,6 +50,8 @@ jobs: - '1.21' runs-on: ${{ matrix.runs-on }} name: Darwin Go ${{ matrix.go }} ${{ join(matrix.runs-on, ' ') }} + env: + HOMEBREW_CACHE: ${{ github.workspace }}/brew-cache steps: - name: Checkout uses: actions/checkout@v4 @@ -69,6 +71,13 @@ jobs: if: matrix.runs-on != 'macos-latest' id: brew-cache-key run: echo "key=$(date +'%Y-%U')" | tee ${GITHUB_OUTPUT} # weekly update 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 }} + restore-keys: ${{ runner.os }}-brew-cache- - name: Cache local brew taps if: matrix.runs-on != 'macos-latest' uses: actions/cache@v4 From 12c9ce4382543fff5abc0cc167a92d9f491d38e5 Mon Sep 17 00:00:00 2001 From: Atsushi Watanabe Date: Tue, 22 Oct 2024 17:56:12 +0900 Subject: [PATCH 2/2] Weekly refresh brew cache --- .github/workflows/ci.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8774a4fb..bfef5faa 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -70,21 +70,19 @@ jobs: - 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 update cache + 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 }} - restore-keys: ${{ runner.os }}-brew-cache- - 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 }} - restore-keys: ${{ runner.os }}-brew-taps- - name: Set up brew to install deps under temporary dir if: matrix.runs-on != 'macos-latest' run: |