Skip to content
Merged
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
36 changes: 22 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: CI

on:
push:
branches: [ main, develop ]
branches: [main, develop]
pull_request:
branches: [ main, develop ]
branches: [main, develop]

jobs:
frontend:
Expand All @@ -19,14 +19,13 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
node-version: "20"
cache: "npm"
cache-dependency-path: package-lock.json

- name: Install dependencies
run: npm ci


- name: Lint
run: npm run lint
working-directory: frontend
Expand Down Expand Up @@ -68,8 +67,8 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
node-version: "20"
cache: "npm"
cache-dependency-path: package-lock.json

- name: Install dependencies
Expand Down Expand Up @@ -128,7 +127,7 @@ jobs:
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: "contracts -> target"
workspace: "contracts -> target"

- name: Check Formatting
run: cargo fmt --all -- --check
Expand Down Expand Up @@ -167,19 +166,28 @@ jobs:
- name: Install Stellar CLI
run: |
curl -fsSL https://github.com/stellar/stellar-cli/raw/main/install.sh | sh -s -- --install-deps
echo "$HOME/.stellar-cli/bin" >> $GITHUB_PATH
shell: bash

- name: Optimize WASM files
run: |
set -euo pipefail
WASMS=$(find contracts/target -type f -name "*.wasm" -print)

# Target the precise release build directory
RELEASE_DIR="contracts/target/wasm32-unknown-unknown/release"

# Use your strict selection logic to target un-optimized raw binaries only
WASMS=$(find "$RELEASE_DIR" -maxdepth 1 -type f -name "*.wasm" ! -name "*.optimized.wasm")

if [ -z "$WASMS" ]; then
echo "No wasm files found"
echo "Error: No raw WASM files found in $RELEASE_DIR"
exit 1
fi

for w in $WASMS; do
out="${w%%.wasm}.optimized.wasm"
echo "Optimizing $w -> $out"
filename=$(basename "$w")
out="$RELEASE_DIR/${filename%.wasm}.optimized.wasm"
echo "Optimizing $filename -> $(basename "$out")"
stellar contract optimize --wasm "$w" --wasm-out "$out"
done
shell: bash
Expand All @@ -188,5 +196,5 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: optimized-wasm
path: |
contracts/target/**/**/*.optimized.wasm
path: contracts/target/wasm32-unknown-unknown/release/*.optimized.wasm
if-no-files-found: error
Loading