Skip to content

Commit

Permalink
Merge pull request #240 from CosmWasm/contract-sanity-checking
Browse files Browse the repository at this point in the history
Add contract sanity checks to CI
  • Loading branch information
maurolacy authored Mar 9, 2021
2 parents 861b3e0 + eb9df96 commit 2ee88aa
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 1,109 deletions.
34 changes: 24 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,6 @@ jobs:
- run:
name: Build and run schema generator
command: cargo schema --locked
- run:
name: Integration Tests
command: |
rustup target add wasm32-unknown-unknown
cargo build --release --target wasm32-unknown-unknown --locked
cargo test --test integration --locked
- run:
name: Ensure checked-in schemas are up-to-date
command: |
Expand Down Expand Up @@ -759,9 +753,10 @@ jobs:
- target/debug/deps
key: cargocache-v2-lint-rust:1.50.0-{{ checksum "Cargo.lock" }}

# this runs one time on the top level to ensure all contracts compile properly into wasm
# we don't run the wasm build and the reuse a lot of the same dependencies, so this should speed up CI time
# for all the other tests
# This runs one time on the top level to ensure all contracts compile properly into wasm.
# We don't run the wasm build per contract build, and then reuse a lot of the same dependencies, so this speeds up CI time
# for all the other tests.
# We also sanity-check the resultant wasm files.
wasm-build:
docker:
- image: rust:1.50.0
Expand All @@ -779,12 +774,31 @@ jobs:
command: rustup target add wasm32-unknown-unknown
- run:
name: Build Wasm Release
command: cargo build --release --target wasm32-unknown-unknown --locked
command: |
for C in ./contracts/*/
do
echo "Compiling `basename $C`..."
(cd $C && cargo build --release --target wasm32-unknown-unknown --locked)
done
- run:
name: Install check_contract
# Uses --debug for compilation speed
# FIXME: Change when `check_contract` (part of `cosmwasm-0.14.0`) is published
#command: cargo install --debug --features iterator --example check_contract -- cosmwasm-vm
command: cargo install --debug --features iterator --git https://github.com/CosmWasm/cosmwasm --branch=main --example check_contract -- cosmwasm-vm
- save_cache:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-wasm-rust:1.50.0-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Check wasm contracts
command: |
for W in ./target/wasm32-unknown-unknown/release/*.wasm
do
echo -n "Checking `basename $W`... "
check_contract $W
done
package_multi_test:
docker:
Expand Down
Loading

0 comments on commit 2ee88aa

Please sign in to comment.