From b6958671d47ab439872b9815fe22e4fbf320f7ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Wo=C5=BAniak?= Date: Mon, 7 Apr 2025 10:08:58 +0200 Subject: [PATCH] test: Check feature powerset on CI --- .github/workflows/ci.yml | 35 ++++++++++++++++++++++---------- sylvia/tests/multitest.rs | 2 +- sylvia/tests/remote.rs | 2 ++ sylvia/tests/reply_data.rs | 2 ++ sylvia/tests/reply_dispatch.rs | 2 ++ sylvia/tests/reply_generation.rs | 2 ++ 6 files changed, 33 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e73d4ce..4b5cffd1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: push: branches: - main - - feat/* + - feat/* pull_request: env: @@ -63,7 +63,7 @@ jobs: - name: Test project no default features run: cargo test --locked --no-default-features - name: Clippy project - run: cargo clippy --all-targets -- -D warnings + run: cargo clippy --all-targets -- -D warnings - name: Fmt check project run: cargo fmt --check @@ -75,7 +75,7 @@ jobs: run: cargo test --locked --no-default-features - name: Clippy examples working-directory: examples - run: cargo clippy --all-targets -- -D warnings + run: cargo clippy --all-targets -- -D warnings - name: Fmt check examples working-directory: examples run: cargo fmt --check @@ -146,11 +146,11 @@ jobs: name: Code coverage runs-on: ubuntu-latest container: - image: xd009642/tarpaulin:0.31.1 - options: --security-opt seccomp=unconfined + image: xd009642/tarpaulin:0.31.1 + options: --security-opt seccomp=unconfined steps: - - name: Checkout sources - uses: actions/checkout@v4 + - name: Checkout sources + uses: actions/checkout@v4 - name: Cache uses: actions/cache@v4 with: @@ -161,12 +161,25 @@ jobs: ~/.cargo/git/db/ target/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Generate code coverage + - name: Generate code coverage run: | cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out xml --engine llvm - - name: Upload to codecov.io - uses: codecov/codecov-action@v5 + - name: Upload to codecov.io + uses: codecov/codecov-action@v5 with: - fail_ci_if_error: true + fail_ci_if_error: true env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + cheack-features: + name: Check all variations of feature sets + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Test with cargo-hack + run: cargo install cargo-hack && cargo hack test --feature-powerset diff --git a/sylvia/tests/multitest.rs b/sylvia/tests/multitest.rs index cfc58258..d98f148a 100644 --- a/sylvia/tests/multitest.rs +++ b/sylvia/tests/multitest.rs @@ -1,4 +1,4 @@ -#![cfg(feature = "mt")] +#![cfg(all(feature = "mt", feature = "cosmwasm_1_2"))] use cw_multi_test::IntoBech32; use std::marker::PhantomData; diff --git a/sylvia/tests/remote.rs b/sylvia/tests/remote.rs index ccc38370..a5267117 100644 --- a/sylvia/tests/remote.rs +++ b/sylvia/tests/remote.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "mt")] + use cosmwasm_schema::cw_serde; use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; diff --git a/sylvia/tests/reply_data.rs b/sylvia/tests/reply_data.rs index ca822c5c..f44dbe1b 100644 --- a/sylvia/tests/reply_data.rs +++ b/sylvia/tests/reply_data.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "mt")] + use cosmwasm_schema::cw_serde; use cosmwasm_std::to_json_binary; use cw_storage_plus::Item; diff --git a/sylvia/tests/reply_dispatch.rs b/sylvia/tests/reply_dispatch.rs index ab4925ea..0a2f8e45 100644 --- a/sylvia/tests/reply_dispatch.rs +++ b/sylvia/tests/reply_dispatch.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "mt")] + use cosmwasm_schema::cw_serde; use cosmwasm_std::{BankMsg, CosmosMsg, Empty, SubMsgResult}; use cw_storage_plus::Item; diff --git a/sylvia/tests/reply_generation.rs b/sylvia/tests/reply_generation.rs index 83a95fdb..1271ab67 100644 --- a/sylvia/tests/reply_generation.rs +++ b/sylvia/tests/reply_generation.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "mt")] + use cosmwasm_std::{Binary, SubMsgResult}; use itertools::Itertools; use sylvia::ctx::InstantiateCtx;