Skip to content

Commit

Permalink
Merge pull request #224 from CronCats/refactoring-scripts
Browse files Browse the repository at this point in the history
[FIX] Remove unused scripts and add optimization for m1
  • Loading branch information
d3v3us authored Dec 22, 2022
2 parents 4131dd5 + 938829c commit eb19b3e
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 41 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/Basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,21 @@ jobs:
with:
command: clippy
args: -- -D warnings


- name: Set latest just version
run: echo "JUST_VERSION=$(cargo search just -q | sed -n -e '/^just[[:space:]]/p' | cut -d '"' -f 2)" >> $GITHUB_ENV

- name: Get cached just
uses: actions/cache@v3
with:
path: ~/.cargo/bin/just
key: ${{ runner.os }}-just-${{ env.JUST_VERSION }}

- name: Install just
run: cargo install just || true

- name: Generate Schema
run: ./scripts/schema.sh
run: just schema

- name: Show Schema changes
run: git status --porcelain
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checksum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: just optimize

- name: Generate Checksum
run: ./scripts/update-checksum.sh
run: just checksum
shell: bash

- name: Show checksum changes
Expand Down
25 changes: 22 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ lint:
cargo fmt --all && cargo clippy -- -D warnings
test:
#!/bin/bash
set -e
export RUSTFLAGS='-C link-arg=-s'
cargo unit-test
cargo wasm
build:
#!/bin/bash
set -e
export RUSTFLAGS='-C link-arg=-s'
cargo build --release --lib --target wasm32-unknown-unknown
deploy:
./scripts/uni-testnet/start.sh -c -w
Expand Down Expand Up @@ -50,12 +50,31 @@ optimize:
--platform linux/amd64 \
cosmwasm/workspace-optimizer:0.12.8

optimize-m1:
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
--platform linux/arm64 \
cosmwasm/workspace-optimizer:0.12.8

optimize-rs:
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer-arm64:0.12.8

optimize-rs-m1:
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer-arm64:0.12.8

download-deps:
mkdir -p artifacts target
wget https://github.com/CosmWasm/cw-plus/releases/latest/download/cw20_base.wasm -O artifacts/cw20_base.wasm
# TODO?: test dao-contracts

all: build test lint schema gen optimize checksum
all: lint build test schema gen optimize checksum
#!/usr/bin/env bash
gas-benchmark: juno-local download-deps optimize
Expand Down
8 changes: 0 additions & 8 deletions scripts/build.sh

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/local/REF.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Build the contract
Building:
```bash
sh build.sh
just build
```
Optimizing the binary size:
```bash
Expand Down
5 changes: 0 additions & 5 deletions scripts/optimized-build-m1.sh

This file was deleted.

5 changes: 0 additions & 5 deletions scripts/optimized-build.sh

This file was deleted.

5 changes: 0 additions & 5 deletions scripts/schema.sh

This file was deleted.

7 changes: 0 additions & 7 deletions scripts/test.sh

This file was deleted.

1 change: 0 additions & 1 deletion scripts/uni-testnet/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ echo "CONTRACT-DIR: $SC_PATH"
echo "SCRIPT-DIR: $SH_DIR"
cd $SC_PATH

$SCRIPTS_PATH/build.sh
echo "Initializing vars"
. $SH_DIR/base/init-vars.sh

Expand Down
3 changes: 0 additions & 3 deletions scripts/update-checksum.sh

This file was deleted.

0 comments on commit eb19b3e

Please sign in to comment.