-
Notifications
You must be signed in to change notification settings - Fork 3
69 lines (62 loc) · 1.97 KB
/
deploy-cw-contracts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: CW Contracts Test Deployment
on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- contracts/**
- .github/workflows/deploy-cw-contracts.yml
jobs:
Build:
name: Build & Deploy CW Contracts
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: true
- name: Start local Archway Blockchain
run: |
cd contracts/archway
sed -i 's/latest/v0.4.0/' docker-compose.yaml
docker compose -f docker-compose.yaml up -d
# git clean submodule directory
git checkout .
git clean -fdx
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.69.0
target: wasm32-unknown-unknown
override: true
profile: minimal
- name: Install cw-check
run: |
cargo install cosmwasm-check --locked
- name: Compile WASM
run: bash ./scripts/generate_wasm.sh
- name: Check WASM Size
run: |
max_size=800
echo "Check if size of wasm file exceeds $max_size kilobytes..."
for file in artifacts/*.wasm; do
size=$(du -k "$file" | awk '{print $1}')
if [[ $size -gt $max_size ]]; then
echo "Error: $file : $size has exceeded maximum contract size limit of 800KB."
exit 1
fi
echo "$file : $size"
done
echo "The size of all contracts is well within the 800 KB limit."
- name: Deploy WASM
run: |
container=$(docker ps --format '{{.Names}}')
cp scripts/deploy_cw.sh contracts/archway/contracts
cp -r artifacts contracts/archway/contracts
docker exec $container chmod +x /contracts/deploy_cw.sh
docker exec $container sh /contracts/deploy_cw.sh