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
67 changes: 67 additions & 0 deletions .github/workflows/contracts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Contracts

on:
push:
branches: [main]
paths:
- "contracts/**"
pull_request:
branches: [main]
paths:
- "contracts/**"

permissions:
contents: read

concurrency:
group: contracts-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-contracts:
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
working-directory: contracts

steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: contracts

- name: Build contracts
run: cargo build --target wasm32-unknown-unknown --release

- name: Run contract tests
run: cargo test

- name: Check contract sizes
shell: bash
run: |
set -euo pipefail
shopt -s nullglob

wasm_files=(target/wasm32-unknown-unknown/release/*.wasm)

if [ ${#wasm_files[@]} -eq 0 ]; then
echo "No WASM artifacts found in target/wasm32-unknown-unknown/release"
exit 1
fi

for wasm in "${wasm_files[@]}"; do
size=$(wc -c < "$wasm")
echo "$wasm: ${size} bytes"

if [ "$size" -gt 65536 ]; then
echo "WARNING: Contract exceeds 64KB limit"
fi
done
29 changes: 0 additions & 29 deletions .github/workflows/soroban_tests.yml

This file was deleted.