Skip to content

Commit 74e00ab

Browse files
committed
CI: make macos' build_samples_wasm_c_api similar to ubuntu
1 parent 73fb1ef commit 74e00ab

File tree

1 file changed

+50
-12
lines changed

1 file changed

+50
-12
lines changed

.github/workflows/compilation_on_macos.yml

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,14 @@ concurrency:
4646
cancel-in-progress: true
4747

4848
env:
49-
AOT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
50-
CLASSIC_INTERP_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
51-
FAST_INTERP_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
52-
LLVM_LAZY_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=1"
53-
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"
49+
# For BUILD
50+
AOT_BUILD_OPTIONS: " -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_FAST_JIT=0 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
51+
CLASSIC_INTERP_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_JIT=0 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
52+
FAST_INTERP_BUILD_OPTIONS: " -DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_JIT=0 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
53+
FAST_JIT_BUILD_OPTIONS: " -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_FAST_JIT=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
54+
LLVM_LAZY_JIT_BUILD_OPTIONS: " -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_FAST_JIT=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=1"
55+
LLVM_EAGER_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_FAST_JIT=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=0"
56+
MULTI_TIER_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_JIT=1 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=1"
5457

5558
permissions:
5659
contents: read
@@ -214,33 +217,68 @@ jobs:
214217
working-directory: product-mini/platforms/${{ matrix.platform }}
215218

216219
build_samples_wasm_c_api:
217-
needs: [build_iwasm]
220+
needs:
221+
[
222+
build_iwasm,
223+
build_llvm_libraries_on_intel_macos,
224+
build_wamrc,
225+
]
218226
runs-on: ${{ matrix.os }}
219227
strategy:
220228
matrix:
221229
make_options: [
222-
# Running modes supported
230+
$AOT_BUILD_OPTIONS,
223231
$CLASSIC_INTERP_BUILD_OPTIONS,
224232
$FAST_INTERP_BUILD_OPTIONS,
225-
# Running modes unsupported
226-
#$LLVM_LAZY_JIT_BUILD_OPTIONS,
227-
#$LLVM_EAGER_JIT_BUILD_OPTIONS,
228-
#$AOT_BUILD_OPTIONS,
233+
$FAST_JIT_BUILD_OPTIONS,
234+
$LLVM_LAZY_JIT_BUILD_OPTIONS,
235+
$LLVM_EAGER_JIT_BUILD_OPTIONS,
236+
$MULTI_TIER_JIT_BUILD_OPTIONS,
229237
]
230238
os: [macos-13]
239+
include:
240+
- os: macos-13
241+
llvm_cache_key: ${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}
242+
231243
steps:
232244
- name: checkout
233245
uses: actions/checkout@v4
234246

247+
- name: Get LLVM libraries
248+
id: retrieve_llvm_libs
249+
if: (!endsWith(matrix.make_options, '_INTERP_BUILD_OPTIONS'))
250+
uses: actions/cache@v4
251+
with:
252+
path: |
253+
./core/deps/llvm/build/bin
254+
./core/deps/llvm/build/include
255+
./core/deps/llvm/build/lib
256+
./core/deps/llvm/build/libexec
257+
./core/deps/llvm/build/share
258+
key: ${{ matrix.llvm_cache_key }}
259+
260+
- name: Quit if cache miss
261+
if: (!endsWith(matrix.make_options, '_INTERP_BUILD_OPTIONS')) && (steps.retrieve_llvm_libs.outputs.cache-hit != 'true')
262+
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
263+
235264
- name: install-wasi-sdk-wabt
236265
uses: ./.github/actions/install-wasi-sdk-wabt
237266
with:
238267
os: ${{ matrix.os }}
239268

269+
- name: Build wamrc
270+
if: (!endsWith(matrix.make_options, '_INTERP_BUILD_OPTIONS'))
271+
run: |
272+
mkdir build && cd build
273+
cmake ..
274+
cmake --build . --config Release --parallel 4
275+
working-directory: wamr-compiler
276+
240277
- name: Build Sample [wasm-c-api]
241278
run: |
279+
VERBOSE=1
242280
cmake -S . -B build ${{ matrix.make_options }}
243-
cmake --build build --config Release --parallel 4
281+
cmake --build build --config Debug --parallel 4
244282
ctest --test-dir build --output-on-failure
245283
working-directory: samples/wasm-c-api
246284

0 commit comments

Comments
 (0)