Skip to content

Commit 784e3ba

Browse files
committed
ci: move size limit from build.yml to lint.yml
1 parent 8590aa4 commit 784e3ba

File tree

2 files changed

+55
-28
lines changed

2 files changed

+55
-28
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,3 @@ jobs:
4343

4444
- name: Build wasm
4545
run: cargo make wasm
46-
47-
- name: Prepare size limit
48-
run: |
49-
cat << EOF > package.json
50-
{
51-
"name": "contracts",
52-
"version": "1.0.0",
53-
"scripts": {
54-
"build": "cargo make wasm"
55-
},
56-
"devDependencies": {
57-
"@size-limit/preset-app": "^7.0.8"
58-
},
59-
"size-limit": [
60-
{
61-
"path": "target/wasm32-unknown-unknown/release/cw_template.wasm",
62-
"running": false,
63-
"brotli": false,
64-
"gzip": false
65-
}
66-
]
67-
}
68-
EOF
69-
70-
- name: Report wasm size limit
71-
uses: andresz1/size-limit-action@v1
72-
with:
73-
github_token: ${{ secrets.OKP4_TOKEN }}

.github/workflows/lint.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,61 @@ jobs:
157157
run: |
158158
cargo make lint-toml
159159
160+
report-wasm-size:
161+
runs-on: ubuntu-20.04
162+
steps:
163+
- name: Check out repository
164+
uses: actions/checkout@v3
165+
166+
- name: Cache cargo registry
167+
uses: actions/cache@v3
168+
with:
169+
path: |
170+
~/.cargo/registry
171+
~/.cargo/git
172+
~/.cargo/bin
173+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
174+
restore-keys: |
175+
${{ runner.os }}-cargo-
176+
177+
- name: Setup rust
178+
uses: actions-rs/toolchain@v1
179+
with:
180+
toolchain: nightly
181+
default: true
182+
override: true
183+
184+
- name: Install cargo make
185+
uses: davidB/rust-cargo-make@v1
186+
187+
- name: Prepare size limit
188+
run: |
189+
cat << EOF > package.json
190+
{
191+
"name": "contracts",
192+
"version": "1.0.0",
193+
"scripts": {
194+
"build": "cargo make wasm"
195+
},
196+
"devDependencies": {
197+
"@size-limit/preset-app": "^7.0.8"
198+
},
199+
"size-limit": [
200+
{
201+
"path": "target/wasm32-unknown-unknown/release/cw_template.wasm",
202+
"running": false,
203+
"brotli": false,
204+
"gzip": false
205+
}
206+
]
207+
}
208+
EOF
209+
210+
- name: Report wasm size limit
211+
uses: andresz1/size-limit-action@v1
212+
with:
213+
github_token: ${{ secrets.OKP4_TOKEN }}
214+
160215
lint-branch-name:
161216
runs-on: ubuntu-20.04
162217
if: github.actor != 'dependabot[bot]' && github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened')

0 commit comments

Comments
 (0)