From 1f8c1f522c5df9a4adcab28cbdc13846369f7929 Mon Sep 17 00:00:00 2001 From: PatTheMav Date: Fri, 2 Jun 2023 21:35:03 +0200 Subject: [PATCH] CI: Update scheduled workflow to refresh macOS dependency caches --- .github/workflows/scheduled.yaml | 53 ++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/.github/workflows/scheduled.yaml b/.github/workflows/scheduled.yaml index 6c16d9d0c..bdc190358 100644 --- a/.github/workflows/scheduled.yaml +++ b/.github/workflows/scheduled.yaml @@ -73,6 +73,59 @@ jobs: --jq '.actions_caches.[] | select(.ref|test("refs/heads/master")|not) | {id, key, ref} | join(";")')" echo '::endgroup::' + macos-build: + name: Build macOS Dependencies + runs-on: macos-13 + strategy: + fail-fast: true + matrix: + target: [macos-arm64, macos-x86_64] + include: + - target: macos-arm64 + config: Release + type: static + - target: macos-x86_64 + config: Release + type: static + defaults: + run: + shell: zsh --no-rcs --errexit --pipefail {0} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Environment + id: setup + run: | + : Setup Environment + + to_remove=() + + for formula (llvm gcc) { + if [[ -d /usr/local/opt/"${formula}" ]] to_remove+=(${formula}) + } + + if (( #to_remove )) brew uninstall --ignore-dependencies ${to_remove} + + local -r date_string=$(date +"%Y-%m-%d") + print "ccacheDate=${date_string} >> $GITHUB_OUTPUT + + - name: Restore Compilation Cache + id: ccache-cache + uses: actions/cache@v3 + with: + path: ${{ github.workspace }}/.ccache + key: ${{ matrix.target }}-ccache-deps-${{ matrix.config }}-${{ steps.setup.outputs.ccacheDate }} + restore-keys: | + ${{ matrix.target }}-ccache-deps-${{ matrix.config }}- + + - name: Build macOS Dependencies + uses: ./.github/actions/build-deps + with: + target: ${{ matrix.target }} + type: ${{ matrix.type }} + config: ${{ matrix.config }} + windows-build: name: Build Windows Dependencies runs-on: windows-2022