-
Notifications
You must be signed in to change notification settings - Fork 1
110 lines (94 loc) · 3.13 KB
/
Copy pathmacos.yml
File metadata and controls
110 lines (94 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: MacOS
on:
push:
branches:
- trunk
- main
pull_request:
branches:
- trunk
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
build:
strategy:
matrix:
include:
# - os: "macos-13"
- os: "macos-latest"
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Restore vcpkg registry
uses: actions/cache/restore@v4
with:
path: |
build/vcpkg_installed/
build/vcpkg_packages/
key: ${{ runner.os }}-vcpkg-${{ hashFiles('./vcpkg*.json', './vcpkg_overlays/**') }}
- name: install dependencies
run: |
brew install pkg-config autoconf autoconf-archive automake coreutils libtool cmake ninja
- name: Install rust dependencies
run: |
cargo install wasm-tools wit-bindgen-cli || true
- name: configure
run: |
cmake --preset linux-ninja-Debug
- name: Fix WASI SDK macOS compiler
run: |
wasi_sdk="${GITHUB_WORKSPACE}/build/vcpkg_installed/arm64-osx/wasi-sdk"
if [[ -f "${wasi_sdk}/libexec/libclang-cpp.dylib" && ! -f "${wasi_sdk}/lib/libclang-cpp.dylib" ]]; then
cp "${wasi_sdk}/libexec/libclang-cpp.dylib" "${wasi_sdk}/lib/libclang-cpp.dylib"
fi
if [[ -f "${wasi_sdk}/libexec/libLLVM.dylib" && ! -f "${wasi_sdk}/lib/libLLVM.dylib" ]]; then
cp "${wasi_sdk}/libexec/libLLVM.dylib" "${wasi_sdk}/lib/libLLVM.dylib"
fi
while IFS= read -r -d '' binary; do
if file "${binary}" | grep -q 'Mach-O'; then
install_name_tool -delete_rpath "@loader_path/../../lib" "${binary}" || true
install_name_tool -add_rpath "@loader_path/../lib" "${binary}" || true
fi
done < <(find "${wasi_sdk}/bin" "${wasi_sdk}/lib" -type f -print0)
test -f "${wasi_sdk}/lib/libclang-cpp.dylib"
test -f "${wasi_sdk}/lib/libLLVM.dylib"
"${wasi_sdk}/bin/clang" --version
- name: build
run: |
cmake --build --preset linux-ninja-Debug
- name: test
working-directory: build
run: |
ctest -VV
- name: Save vcpkg registry
if: always()
uses: actions/cache/save@v4
with:
path: |
build/vcpkg_installed/
build/vcpkg_packages/
key: ${{ runner.os }}-vcpkg-${{ hashFiles('./vcpkg*.json', './vcpkg_overlays/**') }}
- name: Upload error logs
if: ${{ failure() || cancelled() }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-logs
path: ./**/*.log