Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: added build tests with feature flags #96

Merged
merged 5 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 86 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ on:
pull_request:
paths-ignore:
- '**/*.md'
- '**/*.go'

jobs:
test:
build-wasm:
name: Build Wasm
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -40,6 +41,90 @@ jobs:
env:
RUSTFLAGS: "-C link-arg=-s"

build-no-default:
name: Build with No Default Features
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.73.0
override: true

- name: Run unit tests
uses: actions-rs/cargo@v1
with:
command: unit-test
args: --locked --no-default-features
env:
RUST_BACKTRACE: 1

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --locked --no-default-features

build-all-features:
name: Build with All Features
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.73.0
override: true

- name: Run unit tests
uses: actions-rs/cargo@v1
with:
command: unit-test
args: --locked --all-features
env:
RUST_BACKTRACE: 1

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --locked --all-features

build-with-staking:
name: Build with Staking Feature
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.73.0
override: true

- name: Run unit tests
uses: actions-rs/cargo@v1
with:
command: unit-test
args: --locked --features=staking
env:
RUST_BACKTRACE: 1

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --locked --features=staking

lints:
name: Lint Contract
runs-on: ubuntu-latest
Expand Down
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ overflow-checks = true
[features]
# disable export feature to disable all instantiate/execute/query exports
default = ["export", "staking"]
# for more explicit tests, cargo test --features=backtraces
backtraces = ["cosmwasm-std/backtraces"]
export = []
staking = ["cosmwasm-std/staking"]

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ This is a CosmWasm smart contract that communicates with the golang `ica/host` m
- [Using `InstantiateMsg`](#using-instantiatemsg)
- [Using `ExecuteMsg::CreateChannel`](#using-executemsgcreatechannel)
- [Execute an interchain account transaction](#execute-an-interchain-account-transaction)
- [`SendCosmosMsgs` (recommended)](#sendcosmosmsgs-recommended)
- [`SendCustomIcaMessages`](#sendcustomicamessages)
- [`SendCosmosMsgs`](#sendcosmosmsgs)
- [Execute a callback](#execute-a-callback)
- [Channel Closing and Reopening](#channel-closing-and-reopening)
- [Channel Closing](#channel-closing)
Expand Down
Loading