From 17d259fe5d9c132834347e926580fadc2b73b66f Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Tue, 30 Apr 2024 18:59:45 +0200 Subject: [PATCH] workflows: improve macOS workflow Use scripts/mac-toolchain-build hash as the toolchain cache key, so it will be updated automatically. Fix meson build failure. --- .github/workflows/mac.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index ba6b0735cb9b..ab75a7e7c35f 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -11,26 +11,29 @@ jobs: name: Build on macOS runs-on: macos-14 env: - DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_15.3.app/Contents/Developer steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12.3' - name: Toolchain Cache - id: mac-toolchain-arm + id: mac-toolchain uses: actions/cache@v4 with: path: ~/mac-toolchain - key: mac-toolchain-arm + key: ${{ runner.os }}-${{ runner.arch }}-toolchain-${{ hashFiles('**/scripts/mac-toolchain-build') }} - name: Cargo-C Toolchain Cache - id: mac-cargo-c-toolchain-arm + id: mac-cargo-c-toolchain uses: actions/cache@v4 with: path: | ~/.cargo/bin/cargo-capi ~/.cargo/bin/cargo-cbuild ~/.cargo/bin/cargo-cinstall - key: mac-cargo-c-toolchain-arm + key: ${{ runner.os }}-${{ runner.arch }}-cargo-c-toolchain - name: Setup Environment run: | @@ -38,12 +41,13 @@ jobs: rustup target add x86_64-apple-darwin - name: Setup Toolchain - if: steps.mac-toolchain-arm.outputs.cache-hit != 'true' + if: steps.mac-toolchain.outputs.cache-hit != 'true' run: | + pip install setuptools scripts/mac-toolchain-build ~/mac-toolchain - name: Setup Cargo-C Toolchain - if: steps.mac-cargo-c-toolchain-arm.outputs.cache-hit != 'true' + if: steps.mac-cargo-c-toolchain.outputs.cache-hit != 'true' run: | cargo install cargo-c