Skip to content

Commit

Permalink
ci: added build tests with feature flags (#96)
Browse files Browse the repository at this point in the history
* docs: updated toc

* deps: removed backtraces feature

* ci: added more granular feature build testing

* test: that that workflows fail on this commit

* revert: revert broken commit
  • Loading branch information
srdtrk committed Mar 29, 2024
1 parent 8416473 commit 124f9dd
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 5 deletions.
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

0 comments on commit 124f9dd

Please sign in to comment.