-
Notifications
You must be signed in to change notification settings - Fork 84
84 lines (77 loc) · 2.6 KB
/
CI.yml
File metadata and controls
84 lines (77 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
env:
# Real Cloud Run Backend URL for the Frontend
NEXT_PUBLIC_API_URL: https://lance-api-641037923100.us-central1.run.app
# Securely injected via GitHub Actions Secrets
DATABASE_URL: ${{ secrets.DATABASE_URL }}
JUDGE_AUTHORITY_SECRET: ${{ secrets.JUDGE_AUTHORITY_SECRET }}
OPENCLAW_API_KEY: ${{ secrets.OPENCLAW_API_KEY }}
# Contract IDs (Public information, safe to commit)
ESCROW_CONTRACT_ID: CD5E6AXK2J5C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6
REPUTATION_CONTRACT_ID: CD5E6AXK2J5C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6
JOB_REGISTRY_CONTRACT_ID: CD5E6AXK2J5C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6
OPENCLAW_BASE_URL: http://localhost:8080
jobs:
backend:
name: Node.js 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: package-lock.json
- name: Install dependencies
run: npm install --prefix backend
- name: Generate Prisma Client
run: npx prisma generate --schema=backend/prisma/schema.prisma
- name: Build
run: npm run build --prefix backend
contracts:
name: Smart Contracts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: 1.88.0
targets: wasm32-unknown-unknown
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Test Escrow
run: cargo test -p escrow
- name: Build Contracts
run: cargo build --target wasm32-unknown-unknown --release -p escrow -p reputation -p job_registry
- name: Verify Escrow WASM Size
run: |
wasm="target/wasm32-unknown-unknown/release/escrow.wasm"
size=$(stat -c%s "$wasm")
limit=$((80 * 1024))
echo "Escrow WASM size: ${size} bytes"
if [ "$size" -gt "$limit" ]; then
echo "Escrow WASM exceeds ${limit} bytes"
exit 1
fi
web-build:
name: Web Frontend
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: package-lock.json
- name: Install dependencies
run: npm install --prefix apps/web
- name: Build
run: npm run build --prefix apps/web