Skip to content

Commit 0712c7f

Browse files
authored
Fix CI build and run unit tests (#3499)
1 parent 56b4290 commit 0712c7f

File tree

1 file changed

+67
-2
lines changed

1 file changed

+67
-2
lines changed

.github/workflows/compilation_on_android_ubuntu.yml

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919
- "samples/**"
2020
- "!samples/workload/**"
2121
- "tests/wamr-test-suites/**"
22+
- "tests/unit/**"
2223
- "wamr-compiler/**"
2324
- "test-tools/wamr-ide/**"
2425
# will be triggered on push events
@@ -36,6 +37,7 @@ on:
3637
- "samples/**"
3738
- "!samples/workload/**"
3839
- "tests/wamr-test-suites/**"
40+
- "tests/unit/**"
3941
- "wamr-compiler/**"
4042
- "test-tools/wamr-ide/**"
4143
# allow to be triggered manually
@@ -272,10 +274,73 @@ jobs:
272274
cmake --build . --config Release --parallel 4
273275
working-directory: product-mini/platforms/${{ matrix.platform }}
274276

277+
build_unit_tests:
278+
needs:
279+
[
280+
build_llvm_libraries_on_ubuntu_2204,
281+
build_wamrc
282+
]
283+
runs-on: ${{ matrix.os }}
284+
strategy:
285+
fail-fast: false
286+
matrix:
287+
os: [ubuntu-22.04]
288+
wasi_sdk_release:
289+
[
290+
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz",
291+
]
292+
wabt_release:
293+
[
294+
"https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-ubuntu.tar.gz",
295+
]
296+
include:
297+
- os: ubuntu-22.04
298+
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2204.outputs.cache_key }}
299+
steps:
300+
- name: checkout
301+
uses: actions/checkout@v4
302+
303+
- name: Get LLVM libraries
304+
id: retrieve_llvm_libs
305+
uses: actions/cache@v4
306+
with:
307+
path: |
308+
./core/deps/llvm/build/bin
309+
./core/deps/llvm/build/include
310+
./core/deps/llvm/build/lib
311+
./core/deps/llvm/build/libexec
312+
./core/deps/llvm/build/share
313+
key: ${{ matrix.llvm_cache_key }}
314+
315+
- name: Quit if cache miss
316+
if: (steps.retrieve_llvm_libs.outputs.cache-hit != 'true')
317+
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
318+
319+
- name: download and install wasi-sdk
320+
run: |
321+
cd /opt
322+
sudo wget ${{ matrix.wasi_sdk_release }}
323+
sudo tar -xzf wasi-sdk-*.tar.gz
324+
sudo ln -sf wasi-sdk-20.0 wasi-sdk
325+
326+
- name: download and install wabt
327+
run: |
328+
cd /opt
329+
sudo wget ${{ matrix.wabt_release }}
330+
sudo tar -xzf wabt-1.0.31-*.tar.gz
331+
sudo mv wabt-1.0.31 wabt
332+
333+
- name: Build wamrc
334+
run: |
335+
mkdir build && cd build
336+
cmake ..
337+
cmake --build . --config Release --parallel 4
338+
working-directory: wamr-compiler
339+
275340
- name: Build and run unit tests
276341
run: |
277-
mkdir build-unittests && cd build-unittests
278-
cmake .. ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }}
342+
mkdir build && cd build
343+
cmake ..
279344
cmake --build . --config Release --parallel 4
280345
ctest
281346
working-directory: tests/unit

0 commit comments

Comments
 (0)