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

F/optimizer ci #73

Merged
merged 3 commits into from
Sep 27, 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
28 changes: 28 additions & 0 deletions .github/workflows/wasm-tests-full.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: babylonchain/babylon-contract/wasm-tests
on:
push:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
WORKSPACE: "/home/runner/work/babylon-contract/babylon-contract"
jobs:
wasm-build-check-integration:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Build optimised Wasm binaries
run: "./scripts/build-optimizer-ci.sh"
- name: List optimised Wasm binaries
run: bash -c "ls $WORKSPACE/artifacts/*.wasm"
- name: Install cosmwasm-check
run: cargo install --locked --debug --version ^2.0 cosmwasm-check
- name: Check the Wasm binaries' validity
run: bash -c "cosmwasm-check $WORKSPACE/artifacts/*.wasm"
- name: Integration tests based on CosmWasm
run: cargo test --test integration
- uses: actions/[email protected]
with:
path: |-
artifacts/babylon_contract.wasm
artifacts/btc_staking.wasm
artifacts/btc_finality.wasm
14 changes: 1 addition & 13 deletions .github/workflows/wasm-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: babylonchain/babylon-contract/wasm-tests
on:
push:
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
Expand All @@ -14,15 +14,3 @@ jobs:
run: "./scripts/build-optimizer-ci.sh"
- name: List optimised Wasm binaries
run: bash -c "ls $WORKSPACE/artifacts/*.wasm"
- name: Install cosmwasm-check
run: cargo install --locked --debug --version ^2.0 cosmwasm-check
- name: Check the Wasm binaries' validity
run: bash -c "cosmwasm-check $WORKSPACE/artifacts/*.wasm"
- name: Integration tests based on CosmWasm
run: cargo test --test integration
- uses: actions/[email protected]
with:
path: |-
artifacts/babylon_contract.wasm
artifacts/btc_staking.wasm
artifacts/btc_finality.wasm
2 changes: 1 addition & 1 deletion scripts/build-optimizer-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ WORKSPACE="/home/runner/work/babylon-contract/babylon-contract"
BUILDARCH=$(uname -m)
DOCKERFILE=./docker/Dockerfile-ci
OPTIMIZER_IMAGE_NAME="babylonlabs-io/rust-optimizer-$BUILDARCH"
OPTIMIZER_IMAGE_TAG=$(sed -n -E 's/^FROM.*:([^\s]*)\s.*/\1/p' $DOCKERFILE)
OPTIMIZER_IMAGE_TAG=$(sed -n -E 's/^FROM.*:([^ ]*)[ ].*/\1/p' $DOCKERFILE)

$DOCKER build -t $OPTIMIZER_IMAGE_NAME:$OPTIMIZER_IMAGE_TAG -f $DOCKERFILE .

Expand Down