diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8efce77..6210654 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -31,11 +31,9 @@ jobs: sys: - os: ubuntu-latest target: wasm32-unknown-unknown - profile: release test: false - os: ubuntu-latest target: x86_64-unknown-linux-gnu - profile: test test: true runs-on: ${{ matrix.sys.os }} steps: @@ -43,13 +41,9 @@ jobs: - uses: stellar/actions/rust-cache@main - run: rustup update - run: rustup target add ${{ matrix.sys.target }} - - uses: stellar/binaries@v12 - with: - name: cargo-hack - version: 0.5.16 - - run: cargo clippy --profile ${{ matrix.sys.profile }} --target ${{ matrix.sys.target }} --lib + - run: cargo clippy --target ${{ matrix.sys.target }} --lib + - if: matrix.sys.target != 'wasm32-unknown-unknown' + run: cargo clippy --target ${{ matrix.sys.target }} --bins --tests --examples --benches + - run: cargo build --target ${{ matrix.sys.target }} - if: matrix.sys.test - run: cargo hack --feature-powerset clippy --profile ${{ matrix.sys.profile }} --target ${{ matrix.sys.target }} --bins --tests --examples --benches - - run: cargo build --profile ${{ matrix.sys.profile }} --target ${{ matrix.sys.target }} - - if: matrix.sys.test - run: cargo hack --feature-powerset test --profile ${{ matrix.sys.profile }} --target ${{ matrix.sys.target }} + run: cargo test --target ${{ matrix.sys.target }} diff --git a/Cargo.lock b/Cargo.lock index 638ba20..9c3de3b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -659,7 +659,6 @@ version = "0.0.0" dependencies = [ "rand 0.7.3", "soroban-auth", - "soroban-crowdfund-contract", "soroban-sdk", "stellar-xdr", ] diff --git a/Makefile b/Makefile index 947c022..8b4bf2b 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ all: check build test -export RUSTFLAGS=-Dwarnings +export RUSTFLAGS=-Dwarnings -Dclippy::all -Dclippy::pedantic test: fmt cargo test @@ -22,8 +22,8 @@ build: fmt done check: fmt - cargo hack --feature-powerset check --all-targets - cargo check --release --target wasm32-unknown-unknown + cargo clippy --all-targets + cargo clippy --release --target wasm32-unknown-unknown watch: cargo watch --clear --watch-when-idle --shell '$(MAKE)' diff --git a/contracts/crowdfund/Cargo.toml b/contracts/crowdfund/Cargo.toml index 5bbc17a..942a4fe 100644 --- a/contracts/crowdfund/Cargo.toml +++ b/contracts/crowdfund/Cargo.toml @@ -7,11 +7,6 @@ publish = false [lib] crate-type = ["cdylib"] -[features] -default = ["export"] -export = [] -testutils = ["soroban-sdk/testutils", "soroban-auth/testutils", "dep:stellar-xdr"] - [dependencies] soroban-sdk = { version = "0.1.0" } soroban-auth = { version = "0.1.0" } @@ -20,5 +15,4 @@ stellar-xdr = { version = "0.0.6", features = ["next", "std"], optional = true } [dev_dependencies] soroban-sdk = { version = "0.1.0", features = ["testutils"] } soroban-auth = { version = "0.1.0", features = ["testutils"] } -soroban-crowdfund-contract = { path = ".", default-features = false, features = ["testutils"] } rand = { version = "0.7.3" } diff --git a/contracts/crowdfund/src/lib.rs b/contracts/crowdfund/src/lib.rs index 8aa955d..1ab3379 100644 --- a/contracts/crowdfund/src/lib.rs +++ b/contracts/crowdfund/src/lib.rs @@ -7,7 +7,7 @@ mod token { } mod test; -pub mod testutils; +mod testutils; #[derive(Clone)] #[contracttype] diff --git a/contracts/crowdfund/src/test.rs b/contracts/crowdfund/src/test.rs index 1730b69..04390d7 100644 --- a/contracts/crowdfund/src/test.rs +++ b/contracts/crowdfund/src/test.rs @@ -1,7 +1,7 @@ #![cfg(test)] +use super::testutils::{register_test_contract as register_crowdfund, Crowdfund}; use super::token::{Client as Token, TokenMetadata}; -use crate::testutils::{register_test_contract as register_crowdfund, Crowdfund}; use rand::{thread_rng, RngCore}; use soroban_auth::{Identifier, Signature}; use soroban_sdk::{ diff --git a/contracts/crowdfund/src/testutils.rs b/contracts/crowdfund/src/testutils.rs index 42759fa..815735b 100644 --- a/contracts/crowdfund/src/testutils.rs +++ b/contracts/crowdfund/src/testutils.rs @@ -1,4 +1,4 @@ -#![cfg(any(test, feature = "testutils"))] +#![cfg(test)] use crate::CrowdfundClient;