Skip to content

Commit a32b082

Browse files
authored
Add ARM MacOS to the CI (#3120)
Add ARM MacOS to the CI, to prevent regressions like the one fixed in #3102 in the future. And add the AOT compilation to the wasi-threads example.
1 parent a27ddec commit a32b082

File tree

1 file changed

+40
-8
lines changed

1 file changed

+40
-8
lines changed

.github/workflows/compilation_on_macos.yml

+40-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (C) 2019 Intel Corporation. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33

4-
name: compilation on macos-latest
4+
name: compilation on macos
55

66
on:
77
# will be triggered on PR events
@@ -55,20 +55,25 @@ env:
5555
LLVM_EAGER_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=0"
5656

5757
jobs:
58-
build_llvm_libraries:
58+
build_llvm_libraries_on_intel_macos:
5959
uses: ./.github/workflows/build_llvm_libraries.yml
6060
with:
6161
os: "macos-latest"
6262
arch: "X86"
63+
build_llvm_libraries_on_arm_macos:
64+
uses: ./.github/workflows/build_llvm_libraries.yml
65+
with:
66+
os: "macos-14"
67+
arch: "AArch64 ARM"
6368

6469
build_wamrc:
65-
needs: [build_llvm_libraries]
70+
needs: [build_llvm_libraries_on_intel_macos]
6671
runs-on: ${{ matrix.os }}
6772
strategy:
6873
matrix:
6974
include:
7075
- os: macos-latest
71-
llvm_cache_key: ${{ needs.build_llvm_libraries.outputs.cache_key }}
76+
llvm_cache_key: ${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}
7277
steps:
7378
- name: checkout
7479
uses: actions/checkout@v4
@@ -97,7 +102,7 @@ jobs:
97102
working-directory: wamr-compiler
98103

99104
build_iwasm:
100-
needs: [build_llvm_libraries]
105+
needs: [build_llvm_libraries_on_intel_macos]
101106
runs-on: ${{ matrix.os }}
102107
strategy:
103108
matrix:
@@ -171,7 +176,7 @@ jobs:
171176
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
172177
include:
173178
- os: macos-latest
174-
llvm_cache_key: ${{ needs.build_llvm_libraries.outputs.cache_key }}
179+
llvm_cache_key: ${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}
175180
steps:
176181
- name: checkout
177182
uses: actions/checkout@v4
@@ -243,11 +248,11 @@ jobs:
243248
working-directory: samples/wasm-c-api
244249

245250
build_samples_others:
246-
needs: [build_iwasm, build_wamrc]
251+
needs: [build_iwasm, build_wamrc, build_llvm_libraries_on_intel_macos, build_llvm_libraries_on_arm_macos]
247252
runs-on: ${{ matrix.os }}
248253
strategy:
249254
matrix:
250-
os: [macos-latest]
255+
os: [macos-latest, macos-14]
251256
wasi_sdk_release:
252257
[
253258
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-macos.tar.gz",
@@ -256,6 +261,11 @@ jobs:
256261
[
257262
"https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-macos-12.tar.gz",
258263
]
264+
include:
265+
- os: macos-latest
266+
llvm_cache_key: ${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}
267+
- os: macos-14
268+
llvm_cache_key: ${{ needs.build_llvm_libraries_on_arm_macos.outputs.cache_key }}
259269
steps:
260270
- name: checkout
261271
uses: actions/checkout@v4
@@ -320,6 +330,25 @@ jobs:
320330
cmake --build . --config Debug --parallel 4
321331
./hello
322332
333+
- name: Get LLVM libraries
334+
id: retrieve_llvm_libs
335+
uses: actions/cache@v4
336+
with:
337+
path: |
338+
./core/deps/llvm/build/bin
339+
./core/deps/llvm/build/include
340+
./core/deps/llvm/build/lib
341+
./core/deps/llvm/build/libexec
342+
./core/deps/llvm/build/share
343+
key: ${{ matrix.llvm_cache_key }}
344+
345+
- name: Build wamrc
346+
run: |
347+
mkdir build && cd build
348+
cmake ..
349+
cmake --build . --config Release --parallel 4
350+
working-directory: wamr-compiler
351+
323352
- name: Build Sample [wasi-threads]
324353
run: |
325354
cd samples/wasi-threads
@@ -328,6 +357,9 @@ jobs:
328357
cmake --build . --config Debug --parallel 4
329358
./iwasm wasm-apps/no_pthread.wasm
330359
360+
../../../wamr-compiler/build/wamrc --size-level=0 --enable-multi-thread -o wasm-apps/no_pthread.aot wasm-apps/no_pthread.wasm
361+
./iwasm wasm-apps/no_pthread.aot
362+
331363
- name: Build Sample [shared-module]
332364
run: |
333365
cd samples/shared-module

0 commit comments

Comments
 (0)