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
Binary file modified .DS_Store
Binary file not shown.
30 changes: 6 additions & 24 deletions .github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ on:
- "backend/**"

jobs:
test:
name: Test Backend
backend:
name: Backend CI
runs-on: ubuntu-latest

steps:
Expand All @@ -33,28 +33,10 @@ jobs:
working-directory: backend
run: npm test -- --passWithNoTests

- name: Build
working-directory: backend
run: npm run build

lint:
name: Lint Backend
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: backend/package-lock.json

- name: Install dependencies
working-directory: backend
run: npm install

- name: Run linter
working-directory: backend
run: npm run lint

- name: Build
working-directory: backend
run: npm run build
123 changes: 43 additions & 80 deletions .github/workflows/contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,103 +2,66 @@ name: Soroban Contracts CI

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

jobs:
test:
name: Test Contracts
contracts:
name: Contracts CI
runs-on: ubuntu-latest
strategy:
matrix:
contract:
- tip-escrow
- reward-token
- royalty-split
- tip-verification
- auto-royalty-distribution
- tip-goal-campaign
- tip-nft-badge
- fan-token
- artist-allowlist


steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown

components: clippy, rustfmt

- name: Cache Cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
contracts/${{ matrix.contract }}/target/
key: ${{ runner.os }}-cargo-${{ matrix.contract }}-${{ hashFiles(format('contracts/{0}/Cargo.lock', matrix.contract)) }}

- name: Run Tests
working-directory: contracts/${{ matrix.contract }}
run: cargo test --verbose

- name: Build Contract
working-directory: contracts/${{ matrix.contract }}
run: cargo build --target wasm32-unknown-unknown --release

- name: Check WASM Size
working-directory: contracts/${{ matrix.contract }}
~/.cargo/registry/
~/.cargo/git/
contracts/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('contracts/**/Cargo.lock') }}

- name: Run Tests (all contracts)
working-directory: contracts
run: |
CONTRACT_NAME=$(echo "${{ matrix.contract }}" | tr '-' '_')
WASM_FILE="target/wasm32-unknown-unknown/release/${CONTRACT_NAME}.wasm"
if [ -f "$WASM_FILE" ]; then
WASM_SIZE=$(wc -c < "$WASM_FILE")
echo "WASM size: $WASM_SIZE bytes"
if [ $WASM_SIZE -gt 1000000 ]; then
echo "⚠️ Warning: WASM file is larger than 1MB"
fi
else
echo "WASM file not found at $WASM_FILE — skipping size check"
fi
set -euo pipefail
while IFS= read -r manifest; do
dir=$(dirname "$manifest")
echo "Testing $dir"
(cd "$dir" && cargo test --verbose)
done < <(find . -name Cargo.toml -not -path '*/target/*' | sort)

lint:
name: Lint Contracts
runs-on: ubuntu-latest
strategy:
matrix:
contract:
- tip-escrow
- reward-token
- royalty-split
- tip-verification
- auto-royalty-distribution
- tip-goal-campaign
- tip-nft-badge
- fan-token
- artist-allowlist

steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: clippy, rustfmt

- name: Run Clippy
working-directory: contracts/${{ matrix.contract }}
run: cargo clippy -- -D warnings

- name: Check Formatting
working-directory: contracts/${{ matrix.contract }}
run: cargo fmt -- --check
- name: Build All Contracts
working-directory: contracts
run: |
set -euo pipefail
while IFS= read -r manifest; do
dir=$(dirname "$manifest")
echo "Building $dir"
(cd "$dir" && cargo build --target wasm32-unknown-unknown --release)
done < <(find . -name Cargo.toml -not -path '*/target/*' | sort)

- name: Lint All Contracts
working-directory: contracts
run: |
set -euo pipefail
while IFS= read -r manifest; do
dir=$(dirname "$manifest")
echo "Linting $dir"
(cd "$dir" && cargo clippy -- -D warnings)
(cd "$dir" && cargo fmt -- --check)
done < <(find . -name Cargo.toml -not -path '*/target/*' | sort)
42 changes: 42 additions & 0 deletions .github/workflows/frontend-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Frontend CI

on:
push:
branches: [main, develop]
paths:
- "frontend/**"
pull_request:
branches: [main, develop]
paths:
- "frontend/**"

jobs:
frontend:
name: Frontend CI
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: frontend/package-lock.json

- name: Install dependencies
working-directory: frontend
run: npm install

- name: Run tests
working-directory: frontend
run: npm test -- --passWithNoTests

- name: Run linter
working-directory: frontend
run: npm run lint

- name: Build
working-directory: frontend
run: npm run build
Loading
Loading