diff --git a/.github/workflows/ci-contracts-upload-binaries.yml b/.github/workflows/ci-contracts-upload-binaries.yml index 98c41478a8..b53f6a37fb 100644 --- a/.github/workflows/ci-contracts-upload-binaries.yml +++ b/.github/workflows/ci-contracts-upload-binaries.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - platform: [ arc-ubuntu-22.04 ] + platform: [ arc-linux-latest-dind ] runs-on: ${{ matrix.platform }} env: @@ -28,18 +28,11 @@ jobs: mkdir -p $OUTPUT_DIR echo $OUTPUT_DIR - - name: Install Rust stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: wasm32-unknown-unknown - override: true + - name: Build contracts + run: make optimize-contracts - - name: Install cosmwasm-check - run: cargo install cosmwasm-check - - - name: Build release contracts - run: make publish-contracts + - name: Check optimized contracts + run: make docker-check-contracts - name: Prepare build output shell: bash diff --git a/Makefile b/Makefile index c69797c9e3..f5654f816a 100644 --- a/Makefile +++ b/Makefile @@ -154,6 +154,7 @@ CONTRACTS_OUT_DIR = contracts/artifacts # COSMWASM_OPTIMIZER_IMAGE ?= cosmwasm/optimizer:0.17.0 COSMWASM_OPTIMIZER_PLATFORM ?= linux/amd64 +COSMWASM_CHECK_IMAGE ?= rust:1.88 # Ensure clean build environment and run the optimizer optimize-contracts: @@ -179,6 +180,13 @@ optimize-contracts: # Cleanup temporary artefacts directory @rm -rf artifacts 2>/dev/null || true +# Check artifacts with cosmwasm-check inside the optimizer image +docker-check-contracts: + @docker run --rm --platform $(COSMWASM_OPTIMIZER_PLATFORM) \ + -v $(CURDIR):/code --workdir /code \ + --entrypoint /bin/sh \ + $(COSMWASM_CHECK_IMAGE) -lc 'apt-get update && apt-get install -y --no-install-recommends llvm-dev libclang-dev pkg-config && export PATH="/usr/local/cargo/bin:/usr/local/rustup/bin:$$PATH" && cargo install cosmwasm-check --locked && WASMER_ENGINE=universal WASMER_COMPILER=singlepass cosmwasm-check contracts/artifacts/*.wasm' + wasm-opt-contracts: @for WASM in $(WASM_CONTRACT_DIR)/*.wasm; do \ echo "Running wasm-opt on $$WASM"; \