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

Build wasm #2

Merged
merged 10 commits into from
Jan 16, 2024
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
23 changes: 18 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,25 @@ jobs:
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install Rust
run: rustup update stable
run: rustup update 1.72

- name: Install target
run: rustup target add wasm32-unknown-unknown
- name: Install rename
run: sudo apt-get install -y rename

- name: Install rust deps
run: make install

- run: cargo test --workspace --exclude hpl-tests
- name: Run tests
run: cargo test --workspace --exclude hpl-tests

- name: Build wasm
run: make ci-build

- name: Upload wasm archive
uses: actions/upload-artifact@v2
with:
name: wasm_codes
path: wasm_codes.zip

coverage:
runs-on: ubuntu-latest
Expand All @@ -54,7 +67,7 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov

- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --exclude hpl-tests --codecov --output-path codecov.json
run: cargo +nightly llvm-cov --all-features --workspace --exclude hpl-tests --codecov --output-path codecov.json

- name: Upload to codecov.io
uses: codecov/codecov-action@v3
Expand Down
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@

clean:
@cargo clean
@rm -rf ./artifacts

install:
cargo install --force cw-optimizoor cosmwasm-check beaker
rustup target add wasm32-unknown-unknown

schema:
ls ./contracts | xargs -n 1 -t beaker wasm ts-gen

build:
cargo build
cargo wasm

build-dev: clean
cargo cw-optimizoor
rename --force 's/(.*)-(.*)\.wasm/$$1\.wasm/d' artifacts/*

check: build-dev
check: build
ls -d ./artifacts/*.wasm | xargs -I x cosmwasm-check x

ci-build: check
zip -jr wasm_codes.zip artifacts
Loading