Skip to content
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
55 changes: 55 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,61 @@ jobs:
run: |
cargo make lint-toml

report-wasm-size:
runs-on: ubuntu-20.04
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Cache cargo registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: Setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
default: true
override: true

- name: Install cargo make
uses: davidB/rust-cargo-make@v1

- name: Prepare size limit
run: |
cat << EOF > package.json
{
"name": "contracts",
"version": "1.0.0",
"scripts": {
"build": "cargo make wasm"
},
"devDependencies": {
"@size-limit/preset-app": "^7.0.8"
},
"size-limit": [
{
"path": "target/wasm32-unknown-unknown/release/cw_template.wasm",
"running": false,
"brotli": false,
"gzip": false
}
]
}
EOF

- name: Report wasm size limit
uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.OKP4_TOKEN }}

lint-branch-name:
runs-on: ubuntu-20.04
if: github.actor != 'dependabot[bot]' && github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened')
Expand Down
8 changes: 8 additions & 0 deletions .size-limit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
{
"path": "target/wasm32-unknown-unknown/release/cw_template.wasm",
"running": false,
"brotli": false,
"gzip": false
}
]
3 changes: 2 additions & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,12 @@ rustup target add wasm32-unknown-unknown
args = ["build", "--release", "--target", "wasm32-unknown-unknown"]
command = "cargo"
dependencies = ["install_wasm"]
env = { RUSTFLAGS = "-C link-arg=-s" }

[tasks.check_contracts]
dependencies = ["wasm"]
script = '''
cargo install --debug --version 1.0.0 --features iterator --example check_contract -- cosmwasm-vm
if [[ ! -e ~/.cargo/bin/check_contract ]]; then cargo install --debug --version 1.0.0 --features iterator --force --example check_contract -- cosmwasm-vm ; fi
for W in ./target/wasm32-unknown-unknown/release/*.wasm
do
echo -n "Checking `basename $W`... "
Expand Down