11name : MacOS
22
3- # Disabled: Known to fail
4- # To re-enable, uncomment the 'on:' section below
53on :
6- workflow_dispatch : # Manual trigger only
7- # push:
8- # branches:
9- # - trunk
10- # - main
11- # pull_request:
12- # branches:
13- # - trunk
14- # - main
4+ push :
5+ branches :
6+ - trunk
7+ - main
8+ pull_request :
9+ branches :
10+ - trunk
11+ - main
12+ workflow_dispatch :
13+
14+ concurrency :
15+ group : ${{ github.workflow }}
16+ cancel-in-progress : true
1517
1618env :
1719 CTEST_OUTPUT_ON_FAILURE : 1
2224 matrix :
2325 include :
2426 # - os: "macos-13"
25- - os : " macos-14 "
27+ - os : " macos-latest "
2628 fail-fast : false
2729
2830 runs-on : ${{ matrix.os }}
@@ -43,15 +45,13 @@ jobs:
4345 target/
4446 key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
4547
46- - name : Cache vcpkg registry
47- uses : actions/cache@v4
48+ - name : Restore vcpkg registry
49+ uses : actions/cache/restore @v4
4850 with :
4951 path : |
5052 build/vcpkg_installed/
5153 build/vcpkg_packages/
52- key : ${{ runner.os }}-vcpkg-${{ hashFiles('./vcpkg*.json') }}
53- restore-keys : |
54- ${{ runner.os }}-vcpkg-
54+ key : ${{ runner.os }}-vcpkg-${{ hashFiles('./vcpkg*.json', './vcpkg_overlays/**') }}
5555
5656 - name : install dependencies
5757 run : |
6565 run : |
6666 cmake --preset linux-ninja-Debug
6767
68+ - name : Fix WASI SDK macOS compiler
69+ run : |
70+ wasi_sdk="${GITHUB_WORKSPACE}/build/vcpkg_installed/arm64-osx/wasi-sdk"
71+ if [[ -f "${wasi_sdk}/libexec/libclang-cpp.dylib" && ! -f "${wasi_sdk}/lib/libclang-cpp.dylib" ]]; then
72+ cp "${wasi_sdk}/libexec/libclang-cpp.dylib" "${wasi_sdk}/lib/libclang-cpp.dylib"
73+ fi
74+ if [[ -f "${wasi_sdk}/libexec/libLLVM.dylib" && ! -f "${wasi_sdk}/lib/libLLVM.dylib" ]]; then
75+ cp "${wasi_sdk}/libexec/libLLVM.dylib" "${wasi_sdk}/lib/libLLVM.dylib"
76+ fi
77+ while IFS= read -r -d '' binary; do
78+ if file "${binary}" | grep -q 'Mach-O'; then
79+ install_name_tool -delete_rpath "@loader_path/../../lib" "${binary}" || true
80+ install_name_tool -add_rpath "@loader_path/../lib" "${binary}" || true
81+ fi
82+ done < <(find "${wasi_sdk}/bin" "${wasi_sdk}/lib" -type f -print0)
83+ test -f "${wasi_sdk}/lib/libclang-cpp.dylib"
84+ test -f "${wasi_sdk}/lib/libLLVM.dylib"
85+ "${wasi_sdk}/bin/clang" --version
86+
6887 - name : build
6988 run : |
7089 cmake --build --preset linux-ninja-Debug
@@ -81,6 +100,15 @@ jobs:
81100 echo "Running wit-stub-generation-test (failures expected and will be reported)..."
82101 ctest -VV -R "wit-stub-generation-test"
83102
103+ - name : Save vcpkg registry
104+ if : always()
105+ uses : actions/cache/save@v4
106+ with :
107+ path : |
108+ build/vcpkg_installed/
109+ build/vcpkg_packages/
110+ key : ${{ runner.os }}-vcpkg-${{ hashFiles('./vcpkg*.json', './vcpkg_overlays/**') }}
111+
84112 - name : Upload error logs
85113 if : ${{ failure() || cancelled() }}
86114 uses : actions/upload-artifact@v4
0 commit comments