Skip to content

Commit 7ab1b45

Browse files
authored
Merge pull request #5 from okp4/fix/size-limit
Improve size-limit ci action
2 parents 4f370e4 + eded5b1 commit 7ab1b45

File tree

3 files changed

+37
-10
lines changed

3 files changed

+37
-10
lines changed

.github/package.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,5 @@
66
},
77
"devDependencies": {
88
"@size-limit/preset-app": "^7.0.8"
9-
},
10-
"size-limit": [
11-
{
12-
"path": "target/wasm32-unknown-unknown/release/cw_template.wasm",
13-
"running": false,
14-
"brotli": false,
15-
"gzip": false
16-
}
17-
]
9+
}
1810
}

.github/workflows/lint.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ jobs:
159159
160160
report-wasm-size:
161161
runs-on: ubuntu-20.04
162+
if: github.event_name == 'pull_request'
162163
steps:
163164
- name: Check out repository
164165
uses: actions/checkout@v3
@@ -193,6 +194,36 @@ jobs:
193194
with:
194195
github_token: ${{ secrets.OKP4_TOKEN }}
195196

197+
check_contracts:
198+
runs-on: ubuntu-20.04
199+
steps:
200+
- name: Check out repository
201+
uses: actions/checkout@v3
202+
203+
- name: Cache cargo registry
204+
uses: actions/cache@v3
205+
with:
206+
path: |
207+
~/.cargo/registry
208+
~/.cargo/git
209+
~/.cargo/bin
210+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
211+
restore-keys: |
212+
${{ runner.os }}-cargo-
213+
- name: Setup rust
214+
uses: actions-rs/toolchain@v1
215+
with:
216+
toolchain: nightly
217+
default: true
218+
override: true
219+
220+
- name: Install cargo make
221+
uses: davidB/rust-cargo-make@v1
222+
223+
- name: Test rust code
224+
shell: bash
225+
run: cargo make check_contracts
226+
196227
lint-branch-name:
197228
runs-on: ubuntu-20.04
198229
if: github.actor != 'dependabot[bot]' && github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened')

Makefile.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,13 @@ env = { RUSTFLAGS = "-C link-arg=-s" }
9292
[tasks.check_contracts]
9393
dependencies = ["wasm"]
9494
script = '''
95-
if [[ ! -f "$HOME/.cargo/bin/check_contract" ]]; then
95+
CHECK_CONTRACT_PATH=$HOME/.cargo/bin/check_contract
96+
echo "🧐 Check if check_contract is already installed in $CHECK_CONTRACT_PATH"
97+
if ! ls $CHECK_CONTRACT_PATH* 1> /dev/null 2>&1; then
9698
echo "🚚 Installing check_contract binary"
9799
cargo install --debug --version 1.0.0 --features iterator --force --example check_contract -- cosmwasm-vm
100+
else
101+
echo "✅ Using $(check_contract --version)"
98102
fi
99103
100104
for W in ./target/wasm32-unknown-unknown/release/*.wasm

0 commit comments

Comments
 (0)