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

Contract sanity checking #240

Merged
merged 13 commits into from
Mar 9, 2021
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:
maurolacy marked this conversation as resolved.
Show resolved Hide resolved
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