Repository navigation
127 lines (102 loc) · 3.63 KB
/
Copy pathci.yml
File metadata and controls
127 lines (102 loc) · 3.63 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: CI — Build, Lint & Test
on:
push:
branches: [main, dev]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
# ── Backend ────────────────────────────────────────────────────
backend:
name: Backend (Fastify + TypeScript)
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: "22"
cache: "npm"
cache-dependency-path: backend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Type check
run: npx tsc --noEmit
- name: Build
run: npm run build --if-present
# ── Frontend ───────────────────────────────────────────────────
frontend:
name: Frontend (Next.js)
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: "22"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Lint (ESLint — warnings allowed, only errors fail)
# Rules that have pre-existing violations are set to 'warn' in eslint.config.mjs
# so this step reports issues without blocking PRs on legacy code.
run: npm run lint
- name: Generate Prisma Client
run: npx prisma generate
- name: Type check
run: npx tsc --noEmit
- name: Build
run: npm run build
env:
NEXT_PUBLIC_BACKEND_URL: http://localhost:3001
NEXT_PUBLIC_STELLAR_NETWORK: testnet
# ── Soroban Smart Contract ─────────────────────────────────────
contract:
name: Soroban Contract (Rust)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32v1-none
components: clippy, rustfmt
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
contracts/target
key: ${{ runner.os }}-cargo-${{ hashFiles('contracts/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Format check (rustfmt)
run: cargo fmt --check
working-directory: contracts
- name: Lint (clippy)
run: cargo clippy -- -D warnings
working-directory: contracts
- name: Run unit tests
run: cargo test
working-directory: contracts
- name: Install stellar-cli
run: |
STELLAR_VERSION=$(curl -sSL https://api.github.com/repos/stellar/stellar-cli/releases/latest | grep '"tag_name"' | sed 's/.*"v\([^"]*\)".*/\1/')
curl -sSL "https://github.com/stellar/stellar-cli/releases/download/v${STELLAR_VERSION}/stellar-cli-${STELLAR_VERSION}-x86_64-unknown-linux-gnu.tar.gz" | tar -xz
sudo mv stellar /usr/local/bin/stellar
stellar --version
- name: Build contract (WASM)
run: stellar contract build
working-directory: contracts