Skip to content

Testnet Smoke Test

Testnet Smoke Test #53

Workflow file for this run

name: Testnet Smoke Test
on:
workflow_dispatch: # manual trigger
schedule:
- cron: 0 2 * * * # nightly at 02:00 UTC
permissions:
contents: read
jobs:
smoke-test:
name: Deploy and verify on Soroban testnet
runs-on: ubuntu-latest
env:
NETWORK: testnet
NETWORK_PASSPHRASE: Test SDF Network ; September 2015
RPC_URL: https://soroban-testnet.stellar.org
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install Rust and wasm32 target
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Install Stellar CLI
run: cargo install stellar-cli
- name: Build WASM binary
run: cargo build --target wasm32-unknown-unknown --release -p crowdfund
- name: Configure testnet network
run: |
stellar network add testnet \
--rpc-url $RPC_URL \
--network-passphrase "$NETWORK_PASSPHRASE"
- name: Configure testnet identity from secret
env:
TESTNET_SECRET_KEY: ${{ secrets.TESTNET_SECRET_KEY }}
run: |
stellar keys add ci-deployer --secret-key "$TESTNET_SECRET_KEY"
- name: Fund testnet account via Friendbot
run: |
stellar keys fund ci-deployer --network $NETWORK
- name: Deploy contract to testnet
id: deploy
run: |
CONTRACT_ID=$(stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/crowdfund.wasm \
--network $NETWORK \
--source ci-deployer)
echo "CONTRACT_ID=$CONTRACT_ID" >> $GITHUB_ENV
echo "Deployed contract: $CONTRACT_ID"
- name: Initialize campaign
run: |
DEADLINE=$(( $(date +%s) + 86400 ))
CI_ADDR=$(stellar keys address ci-deployer)
stellar contract invoke \
--id $CONTRACT_ID \
--network $NETWORK \
--source ci-deployer \
-- initialize \
--admin $CI_ADDR \
--creator $CI_ADDR \
--token CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC \
--goal 1000 \
--deadline $DEADLINE \
--min_contribution 1
- name: Assert campaign goal is set
run: |
RESULT=$(stellar contract invoke \
--id $CONTRACT_ID \
--network $NETWORK \
--source ci-deployer \
-- goal)
echo "goal: $RESULT"
if [ "$RESULT" != "1000" ]; then
echo "Smoke test FAILED: goal returned $RESULT"
exit 1
fi
- name: Query and log total raised
run: |
RAISED=$(stellar contract invoke \
--id $CONTRACT_ID \
--network $NETWORK \
--source ci-deployer \
-- total_raised)
echo "total_raised: $RAISED"
- name: Log deployed contract address for reference
run: |
echo "Testnet contract address: $CONTRACT_ID"
echo "Contract will expire naturally via TTL — no manual cleanup required."