From bd26ec4a9c2473e13b7e18b160baa57f13602a94 Mon Sep 17 00:00:00 2001 From: Xin Liu Date: Wed, 15 Nov 2023 19:07:42 +0800 Subject: [PATCH] ci(rust-static-lib): update workflow Signed-off-by: Xin Liu --- .github/workflows/rust-static-lib.yml | 51 ++++++++++----------------- 1 file changed, 19 insertions(+), 32 deletions(-) diff --git a/.github/workflows/rust-static-lib.yml b/.github/workflows/rust-static-lib.yml index bdead3f96..f3a60e6b7 100644 --- a/.github/workflows/rust-static-lib.yml +++ b/.github/workflows/rust-static-lib.yml @@ -6,22 +6,15 @@ concurrency: on: push: - branches: - - master - - "rust/*" - paths: - - ".github/workflows/rust-static-lib.yml" - - "bindings/rust/**" - - "include/api/wasmedge/**" - - "lib/api/**" + paths-ignore: + - "**/*.md" + - ".github/workflows/standalone.yml" + - ".github/workflows/ci-build.yml" pull_request: - branches: - - master - paths: - - ".github/workflows/rust-static-lib.yml" - - "bindings/rust/**" - - "include/api/wasmedge/**" - - "lib/api/**" + paths-ignore: + - "**/*.md" + - ".github/workflows/standalone.yml" + - ".github/workflows/ci-build.yml" jobs: build_ubuntu: @@ -30,21 +23,20 @@ jobs: strategy: matrix: os: [ubuntu-22.04] - rust: [1.69, 1.68] + rust: [1.73, 1.72, 1.71] container: - image: wasmedge/wasmedge:latest + image: wasmedge/wasmedge:ubuntu-build-clang steps: - - uses: actions/checkout@v3 + - name: Checkout WasmEdge Rust SDK + uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Build WasmEdge with Release mode + - name: Install dependencies run: | apt update apt install -y software-properties-common libboost-all-dev llvm-15-dev liblld-15-dev ninja-build - cmake cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_LINK_LLVM_STATIC=ON -DWASMEDGE_BUILD_SHARED_LIB=OFF -DWASMEDGE_BUILD_STATIC_LIB=ON -DWASMEDGE_LINK_TOOLS_STATIC=ON -DWASMEDGE_BUILD_PLUGINS=OFF . - cmake --build build - name: Install Rust-nightly uses: dtolnay/rust-toolchain@nightly @@ -52,14 +44,10 @@ jobs: components: rustfmt, clippy - name: Rustfmt - working-directory: bindings/rust/ run: cargo +nightly fmt --all -- --check - name: Clippy - working-directory: bindings/rust/ run: | - export WASMEDGE_DIR="$(pwd)/../../" - export WASMEDGE_BUILD_DIR="$(pwd)/../../build" cargo +nightly clippy -V cargo +nightly clippy --lib --examples --features static -- -D warnings @@ -68,11 +56,10 @@ jobs: with: toolchain: ${{ matrix.rust }} - - name: Test Rust Bindings - working-directory: bindings/rust/ + - name: Test Rust SDK run: | - export WASMEDGE_DIR="$(pwd)/../../" - export WASMEDGE_BUILD_DIR="$(pwd)/../../build" - cargo +nightly -Z sparse-registry update - cargo test --workspace --features static --locked -- --test-threads=1 - cargo test --examples --features static --locked -- --test-threads=1 + cargo test --workspace --locked --features aot,wasmedge_process,ffi -- --nocapture --test-threads=1 + + - name: Test Rust SDK with async feature + run: | + cargo test --workspace --locked --features aot,async,wasmedge_process,ffi -- --nocapture --test-threads=1