Skip to content

Commit

Permalink
Merge pull request #2 from hyperlane-xyz/nambrot/ci-wasm-build
Browse files Browse the repository at this point in the history
Build wasm
  • Loading branch information
yorhodes authored Jan 16, 2024
2 parents 26f040f + 189ecf3 commit 2cd2bfc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,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 @@ -52,7 +65,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

0 comments on commit 2cd2bfc

Please sign in to comment.