mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-11 09:25:20 +00:00
Fix CI build and run unit tests (#3499)
This commit is contained in:
parent
56b42908a8
commit
0712c7f361
|
@ -19,6 +19,7 @@ on:
|
||||||
- "samples/**"
|
- "samples/**"
|
||||||
- "!samples/workload/**"
|
- "!samples/workload/**"
|
||||||
- "tests/wamr-test-suites/**"
|
- "tests/wamr-test-suites/**"
|
||||||
|
- "tests/unit/**"
|
||||||
- "wamr-compiler/**"
|
- "wamr-compiler/**"
|
||||||
- "test-tools/wamr-ide/**"
|
- "test-tools/wamr-ide/**"
|
||||||
# will be triggered on push events
|
# will be triggered on push events
|
||||||
|
@ -36,6 +37,7 @@ on:
|
||||||
- "samples/**"
|
- "samples/**"
|
||||||
- "!samples/workload/**"
|
- "!samples/workload/**"
|
||||||
- "tests/wamr-test-suites/**"
|
- "tests/wamr-test-suites/**"
|
||||||
|
- "tests/unit/**"
|
||||||
- "wamr-compiler/**"
|
- "wamr-compiler/**"
|
||||||
- "test-tools/wamr-ide/**"
|
- "test-tools/wamr-ide/**"
|
||||||
# allow to be triggered manually
|
# allow to be triggered manually
|
||||||
|
@ -272,10 +274,73 @@ jobs:
|
||||||
cmake --build . --config Release --parallel 4
|
cmake --build . --config Release --parallel 4
|
||||||
working-directory: product-mini/platforms/${{ matrix.platform }}
|
working-directory: product-mini/platforms/${{ matrix.platform }}
|
||||||
|
|
||||||
|
build_unit_tests:
|
||||||
|
needs:
|
||||||
|
[
|
||||||
|
build_llvm_libraries_on_ubuntu_2204,
|
||||||
|
build_wamrc
|
||||||
|
]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-22.04]
|
||||||
|
wasi_sdk_release:
|
||||||
|
[
|
||||||
|
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz",
|
||||||
|
]
|
||||||
|
wabt_release:
|
||||||
|
[
|
||||||
|
"https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-ubuntu.tar.gz",
|
||||||
|
]
|
||||||
|
include:
|
||||||
|
- os: ubuntu-22.04
|
||||||
|
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2204.outputs.cache_key }}
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Get LLVM libraries
|
||||||
|
id: retrieve_llvm_libs
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
./core/deps/llvm/build/bin
|
||||||
|
./core/deps/llvm/build/include
|
||||||
|
./core/deps/llvm/build/lib
|
||||||
|
./core/deps/llvm/build/libexec
|
||||||
|
./core/deps/llvm/build/share
|
||||||
|
key: ${{ matrix.llvm_cache_key }}
|
||||||
|
|
||||||
|
- name: Quit if cache miss
|
||||||
|
if: (steps.retrieve_llvm_libs.outputs.cache-hit != 'true')
|
||||||
|
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
|
||||||
|
|
||||||
|
- name: download and install wasi-sdk
|
||||||
|
run: |
|
||||||
|
cd /opt
|
||||||
|
sudo wget ${{ matrix.wasi_sdk_release }}
|
||||||
|
sudo tar -xzf wasi-sdk-*.tar.gz
|
||||||
|
sudo ln -sf wasi-sdk-20.0 wasi-sdk
|
||||||
|
|
||||||
|
- name: download and install wabt
|
||||||
|
run: |
|
||||||
|
cd /opt
|
||||||
|
sudo wget ${{ matrix.wabt_release }}
|
||||||
|
sudo tar -xzf wabt-1.0.31-*.tar.gz
|
||||||
|
sudo mv wabt-1.0.31 wabt
|
||||||
|
|
||||||
|
- name: Build wamrc
|
||||||
|
run: |
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake ..
|
||||||
|
cmake --build . --config Release --parallel 4
|
||||||
|
working-directory: wamr-compiler
|
||||||
|
|
||||||
- name: Build and run unit tests
|
- name: Build and run unit tests
|
||||||
run: |
|
run: |
|
||||||
mkdir build-unittests && cd build-unittests
|
mkdir build && cd build
|
||||||
cmake .. ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }}
|
cmake ..
|
||||||
cmake --build . --config Release --parallel 4
|
cmake --build . --config Release --parallel 4
|
||||||
ctest
|
ctest
|
||||||
working-directory: tests/unit
|
working-directory: tests/unit
|
||||||
|
|
Loading…
Reference in New Issue
Block a user