Skip to content

Commit

Permalink
ci: check wasm contract
Browse files Browse the repository at this point in the history
  • Loading branch information
bdeneux committed Jul 13, 2022
1 parent 74135c1 commit a184ec2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,33 @@ jobs:

- name: Test rust code
run: cargo make test-coverage

check_contracts:
runs-on: ubuntu-20.04
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Cache cargo registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
default: true
override: true

- name: Install cargo make
uses: davidB/rust-cargo-make@v1

- name: Test rust code
run: cargo make check_contracts
11 changes: 11 additions & 0 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,16 @@ args = ["build", "--release", "--target", "wasm32-unknown-unknown"]
command = "cargo"
dependencies = ["install_wasm"]

[tasks.check_contracts]
dependencies = ["wasm"]
script = '''
cargo install --debug --version 1.0.0 --features iterator --example check_contract -- cosmwasm-vm
for W in ./target/wasm32-unknown-unknown/release/*.wasm
do
echo -n "Checking `basename $W`... "
check_contract $W
done
'''

[config]
default_to_workspace = false

0 comments on commit a184ec2

Please sign in to comment.