From e40b05a5c6a3e5831714d6ff61dae8f6dd9bf426 Mon Sep 17 00:00:00 2001 From: "liang.he" Date: Fri, 1 Aug 2025 14:31:36 +0800 Subject: [PATCH] Add smoke tests for iwasm and wamrc binaries to validate build output (#4455) --- .github/workflows/build_iwasm_release.yml | 130 +++++++++++++--------- .github/workflows/build_wamrc.yml | 24 ++++ 2 files changed, 101 insertions(+), 53 deletions(-) diff --git a/.github/workflows/build_iwasm_release.yml b/.github/workflows/build_iwasm_release.yml index 6acd90fa6..d1bdd685d 100644 --- a/.github/workflows/build_iwasm_release.yml +++ b/.github/workflows/build_iwasm_release.yml @@ -32,60 +32,60 @@ on: required: false env: - DEFAULT_BUILD_OPTIONS: + DEFAULT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_JIT=1 -DWAMR_BUILD_JIT=1 \ - -DWAMR_BUILD_CUSTOM_NAME_SECTION=0 \ - -DWAMR_BUILD_DEBUG_INTERP=0 \ - -DWAMR_BUILD_DEBUG_AOT=0 \ - -DWAMR_BUILD_DUMP_CALL_STACK=0 \ - -DWAMR_BUILD_LIBC_UVWASI=0 \ - -DWAMR_BUILD_LIBC_EMCC=0 \ - -DWAMR_BUILD_LIB_RATS=0 \ - -DWAMR_BUILD_LOAD_CUSTOM_SECTION=0 \ - -DWAMR_BUILD_MEMORY_PROFILING=0 \ - -DWAMR_BUILD_MINI_LOADER=0 \ - -DWAMR_BUILD_MULTI_MODULE=0 \ - -DWAMR_BUILD_PERF_PROFILING=0 \ - -DWAMR_BUILD_SPEC_TEST=0 \ - -DWAMR_BUILD_BULK_MEMORY=1 \ - -DWAMR_BUILD_LIB_PTHREAD=1 \ - -DWAMR_BUILD_LIB_PTHREAD_SEMAPHORE=1 \ - -DWAMR_BUILD_LIB_WASI_THREADS=1 \ - -DWAMR_BUILD_LIBC_BUILTIN=1 \ - -DWAMR_BUILD_LIBC_WASI=1 \ - -DWAMR_BUILD_REF_TYPES=1 \ - -DWAMR_BUILD_SIMD=1 \ - -DWAMR_BUILD_SHARED_MEMORY=1 \ - -DWAMR_BUILD_TAIL_CALL=1 \ - -DWAMR_BUILD_THREAD_MGR=1" + -DWAMR_BUILD_CUSTOM_NAME_SECTION=0 \ + -DWAMR_BUILD_DEBUG_INTERP=0 \ + -DWAMR_BUILD_DEBUG_AOT=0 \ + -DWAMR_BUILD_DUMP_CALL_STACK=0 \ + -DWAMR_BUILD_LIBC_UVWASI=0 \ + -DWAMR_BUILD_LIBC_EMCC=0 \ + -DWAMR_BUILD_LIB_RATS=0 \ + -DWAMR_BUILD_LOAD_CUSTOM_SECTION=0 \ + -DWAMR_BUILD_MEMORY_PROFILING=0 \ + -DWAMR_BUILD_MINI_LOADER=0 \ + -DWAMR_BUILD_MULTI_MODULE=0 \ + -DWAMR_BUILD_PERF_PROFILING=0 \ + -DWAMR_BUILD_SPEC_TEST=0 \ + -DWAMR_BUILD_BULK_MEMORY=1 \ + -DWAMR_BUILD_LIB_PTHREAD=1 \ + -DWAMR_BUILD_LIB_PTHREAD_SEMAPHORE=1 \ + -DWAMR_BUILD_LIB_WASI_THREADS=1 \ + -DWAMR_BUILD_LIBC_BUILTIN=1 \ + -DWAMR_BUILD_LIBC_WASI=1 \ + -DWAMR_BUILD_REF_TYPES=1 \ + -DWAMR_BUILD_SIMD=1 \ + -DWAMR_BUILD_SHARED_MEMORY=1 \ + -DWAMR_BUILD_TAIL_CALL=1 \ + -DWAMR_BUILD_THREAD_MGR=1" GC_EH_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_FAST_JIT=0 -DWAMR_BUILD_JIT=0 \ - -DWAMR_BUILD_CUSTOM_NAME_SECTION=0 \ - -DWAMR_BUILD_DEBUG_INTERP=0 \ - -DWAMR_BUILD_DEBUG_AOT=0 \ - -DWAMR_BUILD_DUMP_CALL_STACK=0 \ - -DWAMR_BUILD_LIBC_UVWASI=0 \ - -DWAMR_BUILD_LIBC_EMCC=0 \ - -DWAMR_BUILD_LIB_RATS=0 \ - -DWAMR_BUILD_LOAD_CUSTOM_SECTION=0 \ - -DWAMR_BUILD_MEMORY_PROFILING=0 \ - -DWAMR_BUILD_MINI_LOADER=0 \ - -DWAMR_BUILD_MULTI_MODULE=0 \ - -DWAMR_BUILD_PERF_PROFILING=0 \ - -DWAMR_BUILD_SPEC_TEST=0 \ - -DWAMR_BUILD_BULK_MEMORY=1 \ - -DWAMR_BUILD_LIB_PTHREAD=1 \ - -DWAMR_BUILD_LIB_PTHREAD_SEMAPHORE=1 \ - -DWAMR_BUILD_LIB_WASI_THREADS=1 \ - -DWAMR_BUILD_LIBC_BUILTIN=1 \ - -DWAMR_BUILD_LIBC_WASI=1 \ - -DWAMR_BUILD_REF_TYPES=1 \ - -DWAMR_BUILD_SIMD=1 \ - -DWAMR_BUILD_SHARED_MEMORY=1 \ - -DWAMR_BUILD_TAIL_CALL=1 \ - -DWAMR_BUILD_THREAD_MGR=1 \ - -DWAMR_BUILD_EXCE_HANDLING=1 \ - -DWAMR_BUILD_GC=1" + -DWAMR_BUILD_CUSTOM_NAME_SECTION=0 \ + -DWAMR_BUILD_DEBUG_INTERP=0 \ + -DWAMR_BUILD_DEBUG_AOT=0 \ + -DWAMR_BUILD_DUMP_CALL_STACK=0 \ + -DWAMR_BUILD_LIBC_UVWASI=0 \ + -DWAMR_BUILD_LIBC_EMCC=0 \ + -DWAMR_BUILD_LIB_RATS=0 \ + -DWAMR_BUILD_LOAD_CUSTOM_SECTION=0 \ + -DWAMR_BUILD_MEMORY_PROFILING=0 \ + -DWAMR_BUILD_MINI_LOADER=0 \ + -DWAMR_BUILD_MULTI_MODULE=0 \ + -DWAMR_BUILD_PERF_PROFILING=0 \ + -DWAMR_BUILD_SPEC_TEST=0 \ + -DWAMR_BUILD_BULK_MEMORY=1 \ + -DWAMR_BUILD_LIB_PTHREAD=1 \ + -DWAMR_BUILD_LIB_PTHREAD_SEMAPHORE=1 \ + -DWAMR_BUILD_LIB_WASI_THREADS=1 \ + -DWAMR_BUILD_LIBC_BUILTIN=1 \ + -DWAMR_BUILD_LIBC_WASI=1 \ + -DWAMR_BUILD_REF_TYPES=1 \ + -DWAMR_BUILD_SIMD=1 \ + -DWAMR_BUILD_SHARED_MEMORY=1 \ + -DWAMR_BUILD_TAIL_CALL=1 \ + -DWAMR_BUILD_THREAD_MGR=1 \ + -DWAMR_BUILD_EXCE_HANDLING=1 \ + -DWAMR_BUILD_GC=1" permissions: contents: read @@ -97,9 +97,9 @@ jobs: matrix: include: - build_options: $DEFAULT_BUILD_OPTIONS - suffix: '' + suffix: "" - build_options: $GC_EH_BUILD_OPTIONS - suffix: '-gc-eh' + suffix: "-gc-eh" permissions: contents: write # for uploading release artifacts @@ -126,6 +126,30 @@ jobs: cmake --build build --config Release --parallel 4 working-directory: ${{ inputs.cwd }} + - name: smoke test on non-Windows + if: ${{ !startsWith(inputs.runner, 'windows') }} + shell: bash + run: | + if [[ ! -f build/iwasm ]]; then + echo "iwasm binary is not found in the expected location." + exit 1 + fi + + build/iwasm --version + working-directory: ${{ inputs.cwd }} + + - name: smoke test on Windows + if: ${{ startsWith(inputs.runner, 'windows') }} + shell: bash + run: | + if [[ ! -f build/Release/iwasm ]]; then + echo "iwasm binary is not found in the expected location." + exit 1 + fi + + build/Release/iwasm --version + working-directory: ${{ inputs.cwd }} + - name: Compress the binary on Windows if: inputs.runner == 'windows-latest' run: | diff --git a/.github/workflows/build_wamrc.yml b/.github/workflows/build_wamrc.yml index 07e3c7cdb..df257723f 100644 --- a/.github/workflows/build_wamrc.yml +++ b/.github/workflows/build_wamrc.yml @@ -62,6 +62,30 @@ jobs: cmake --build build --config Release --parallel 4 working-directory: wamr-compiler + - name: smoke test on non-windows + if: ${{ !startsWith(inputs.runner, 'windows') }} + shell: bash + run: | + if [[ ! -f build/wamrc ]]; then + echo "wamrc binary is not found in the expected location." + exit 1 + fi + + build/wamrc --version + working-directory: wamr-compiler + + - name: smoke test on Windows + if: ${{ startsWith(inputs.runner, 'windows') }} + shell: bash + run: | + if [[ ! -f build/Release/wamrc ]]; then + echo "wamrc binary is not found in the expected location." + exit 1 + fi + + build/Release/wamrc --version + working-directory: wamr-compiler + - name: Compress the binary on Windows if: inputs.runner == 'windows-latest' && inputs.release run: |