feat: add boilerplate for asset manager contract #73
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |