From c2c2804767b0801c539c67fc5cf8b586af3135fa Mon Sep 17 00:00:00 2001 From: nambrot Date: Tue, 9 Jan 2024 16:04:51 -0500 Subject: [PATCH 01/10] Build wasm --- .github/workflows/test.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7959e3cd..9462f34d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -30,12 +30,19 @@ jobs: key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Install Rust - run: rustup update stable + run: rustup update 1.69 - name: Install target run: rustup target add wasm32-unknown-unknown - - run: cargo test --workspace --exclude hpl-tests + - name: Install cw-optimizoor + run: cargo install cw-optimizoor + + - name: Run tests + run: cargo test --workspace --exclude hpl-tests + + - name: Optimize wasm + run: cargo cw-optimizoor coverage: runs-on: ubuntu-latest From 63c62bb7ad536412dd3a2738b6d91361509edf63 Mon Sep 17 00:00:00 2001 From: nambrot Date: Tue, 9 Jan 2024 17:44:00 -0500 Subject: [PATCH 02/10] Upload artifacts --- .github/workflows/test.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9462f34d..5d787d4a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -44,6 +44,18 @@ jobs: - name: Optimize wasm run: cargo cw-optimizoor + - name: Rename + run: rename 's/(.*)(-aarch64)(.*)/$1$3/d' * + + - name: Zip + run: cd artifacts && zip -r ../wasm_codes.zip * && cd ../ + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: wasm_codes + path: wasm_codes.zip + coverage: runs-on: ubuntu-latest env: @@ -61,7 +73,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 From ae2706d3d8fb682a44a024435969b59e4d3e13b3 Mon Sep 17 00:00:00 2001 From: nambrot Date: Tue, 9 Jan 2024 17:59:29 -0500 Subject: [PATCH 03/10] Force --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5d787d4a..bad3686f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -35,7 +35,7 @@ jobs: - name: Install target run: rustup target add wasm32-unknown-unknown - - name: Install cw-optimizoor + - name: Install cw-optimizoor --force run: cargo install cw-optimizoor - name: Run tests From 46d3e36f512f1c3a215a23dd7701fe611ce4bd95 Mon Sep 17 00:00:00 2001 From: nambrot Date: Wed, 10 Jan 2024 15:51:01 -0500 Subject: [PATCH 04/10] Move into makefile --- .github/workflows/test.yaml | 13 ++----------- Makefile | 6 ++++++ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index bad3686f..db5cb10f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -35,20 +35,11 @@ jobs: - name: Install target run: rustup target add wasm32-unknown-unknown - - name: Install cw-optimizoor --force - run: cargo install cw-optimizoor - - name: Run tests run: cargo test --workspace --exclude hpl-tests - - name: Optimize wasm - run: cargo cw-optimizoor - - - name: Rename - run: rename 's/(.*)(-aarch64)(.*)/$1$3/d' * - - - name: Zip - run: cd artifacts && zip -r ../wasm_codes.zip * && cd ../ + - name: Build wasm + run: make ci-build - name: Upload artifacts uses: actions/upload-artifact@v2 diff --git a/Makefile b/Makefile index fa2176ef..fa69ad5b 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,12 @@ clean: schema: ls ./contracts | xargs -n 1 -t beaker wasm ts-gen +ci-build: + cargo install cw-optimizoor --force + cargo cw-optimizoor + rename 's/(.*)(-x86)(.*)/$1$3/d' * + cd artifacts && zip -r ../wasm_codes.zip * && cd ../ + build: cargo wasm From f7af326f0ad816c31929d00c11062cf1ecf78497 Mon Sep 17 00:00:00 2001 From: nambrot Date: Wed, 10 Jan 2024 19:51:47 -0500 Subject: [PATCH 05/10] Install rename --- .github/workflows/test.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index db5cb10f..1d21d0f5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -32,6 +32,9 @@ jobs: - name: Install Rust run: rustup update 1.69 + - name: Install rename + run: apt-get install -y rename + - name: Install target run: rustup target add wasm32-unknown-unknown From 280fb0786568ed71dfd8604e662b0af2a3e32167 Mon Sep 17 00:00:00 2001 From: nambrot Date: Wed, 10 Jan 2024 19:52:33 -0500 Subject: [PATCH 06/10] Rename properly --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fa69ad5b..1abcc23b 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ schema: ci-build: cargo install cw-optimizoor --force cargo cw-optimizoor - rename 's/(.*)(-x86)(.*)/$1$3/d' * + rename 's/(.*)(-x86_64)(.*)/$1$3/d' * cd artifacts && zip -r ../wasm_codes.zip * && cd ../ build: From d5666cd6774df04ab611ad9ce8663e717cc25a51 Mon Sep 17 00:00:00 2001 From: Nam Chu Hoai Date: Fri, 12 Jan 2024 14:22:16 -0500 Subject: [PATCH 07/10] Update test.yaml --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1d21d0f5..90919b87 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -33,7 +33,7 @@ jobs: run: rustup update 1.69 - name: Install rename - run: apt-get install -y rename + run: sudo apt-get install -y rename - name: Install target run: rustup target add wasm32-unknown-unknown From 04468ba1896b416ac97aa7a85ea638916460f467 Mon Sep 17 00:00:00 2001 From: Yorke Rhodes Date: Tue, 16 Jan 2024 17:39:13 -0500 Subject: [PATCH 08/10] Fix renaming --- .github/workflows/test.yaml | 8 ++++---- Makefile | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 90919b87..d67cf536 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -30,13 +30,13 @@ jobs: key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Install Rust - run: rustup update 1.69 + run: rustup update 1.72 - name: Install rename run: sudo apt-get install -y rename - - name: Install target - run: rustup target add wasm32-unknown-unknown + - name: Install rust deps + run: make install - name: Run tests run: cargo test --workspace --exclude hpl-tests @@ -44,7 +44,7 @@ jobs: - name: Build wasm run: make ci-build - - name: Upload artifacts + - name: Upload wasm archive uses: actions/upload-artifact@v2 with: name: wasm_codes diff --git a/Makefile b/Makefile index 1abcc23b..3c2b8962 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,22 @@ - clean: @cargo clean @rm -rf ./artifacts +install: + cargo install cw-optimizoor cosmwasm-check beaker + rustup target add wasm32-unknown-unknown + schema: ls ./contracts | xargs -n 1 -t beaker wasm ts-gen -ci-build: - cargo install cw-optimizoor --force - cargo cw-optimizoor - rename 's/(.*)(-x86_64)(.*)/$1$3/d' * - cd artifacts && zip -r ../wasm_codes.zip * && cd ../ - 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 From ddb174b1b77b24b13a9b1beb7210c73955bb9ff3 Mon Sep 17 00:00:00 2001 From: Yorke Rhodes Date: Tue, 16 Jan 2024 17:41:34 -0500 Subject: [PATCH 09/10] Fix makefile indentation --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3c2b8962..9c0c898d 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ clean: install: cargo install cw-optimizoor cosmwasm-check beaker - rustup target add wasm32-unknown-unknown + rustup target add wasm32-unknown-unknown schema: ls ./contracts | xargs -n 1 -t beaker wasm ts-gen From 189ecf3ed7ada06f37905f1fab6a4828521f5230 Mon Sep 17 00:00:00 2001 From: Yorke Rhodes Date: Tue, 16 Jan 2024 17:51:26 -0500 Subject: [PATCH 10/10] Force cargo install --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9c0c898d..a7b1cf3e 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ clean: @rm -rf ./artifacts install: - cargo install cw-optimizoor cosmwasm-check beaker + cargo install --force cw-optimizoor cosmwasm-check beaker rustup target add wasm32-unknown-unknown schema: