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

fix: add voting_with_uuid to README and tests in actions #205

Merged
merged 1 commit into from
Jun 3, 2022
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
55 changes: 55 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,52 @@ jobs:
exit 1
fi

contract_voting_with_uuid:
name: contract_voting_with_uuid
runs-on: ubuntu-latest
env:
working-directory: ./contracts/voting_with_uuid
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.57.0
target: wasm32-unknown-unknown
profile: minimal
override: true
- name: Cache cargo
uses: actions/cache@v2
with:
path: ~/.cargo
key: cargocache-v2-contract_staking-rust:1.57.0-${{ hashFiles('contracts/voting_with_uuid/Cargo.lock') }}
- name: Version information
run: rustc --version; cargo --version; rustup --version; rustup target list --installed
- name: Add wasm32 target
run: rustup target add wasm32-unknown-unknown && rustup target list --installed
- name: Build wasm binary
working-directory: ${{env.working-directory}}
run: cargo wasm --locked
- name: Unit tests
working-directory: ${{env.working-directory}}
run: cargo unit-test --locked
- name: Integration tests (singlepass backend)
working-directory: ${{env.working-directory}}
run: cargo integration-test --locked --no-default-features
- name: Build and run schema generator
working-directory: ${{env.working-directory}}
run: cargo schema --locked
- name: Ensure schemas are up-to-date
working-directory: ${{env.working-directory}}
run: |
CHANGES_IN_REPO=$(git status --porcelain)
if [[ -n "$CHANGES_IN_REPO" ]]; then
echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:"
git status && git --no-pager diff
exit 1
fi

fmt:
name: fmt
runs-on: ubuntu-latest
Expand Down Expand Up @@ -651,6 +697,9 @@ jobs:
- name: Check formatting of contract staking
working-directory: ${{env.root-directory}}/staking
run: cargo fmt -- --check
- name: Check formatting of contract voting-with-uuid
working-directory: ${{env.root-directory}}/voting-with-uuid
run: cargo fmt -- --check

clippy:
name: clippy
Expand Down Expand Up @@ -758,3 +807,9 @@ jobs:
mkdir -p target/wasm32-unknown-unknown/release
touch target/wasm32-unknown-unknown/release/staking.wasm
cargo clippy --tests -- -D warnings
- name: Clippy linting on voting-with-uuid
working-directory: ${{env.contracts}}/voting-with-uuid
run: |
mkdir -p target/wasm32-unknown-unknown/release
touch target/wasm32-unknown-unknown/release/staking.wasm
cargo clippy --tests -- -D warnings
22 changes: 14 additions & 8 deletions contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,24 @@ docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="devcontract_cache_staking",target=/code/contracts/staking/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.12.5 ./contracts/staking

docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="devcontract_cache_voting_with_uuid",target=/code/contracts/voting-with-uuid/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.12.5 ./contracts/voting-with-uuid
```

## Entry points

The development contracts in this folder contain a variety of different entry
points in order to demonstrate and test the flexibility we have.

| Contract | Has `query` | Has `migrate` |
| ----------- | ----------- | ------------- |
| burner | no | yes |
| hackatom | yes | yes |
| ibc-reflect | yes | no |
| queue | yes | yes |
| reflect | yes | no |
| staking | yes | no |
| Contract | Has `query` | Has `migrate` |
| ---------------- | ----------- | ------------- |
| burner | no | yes |
| hackatom | yes | yes |
| ibc-reflect | yes | no |
| queue | yes | yes |
| reflect | yes | no |
| staking | yes | no |
| voting-with-uuid | yes | no |