forked from Emmy123222/Stellar-MicroPay
-
Notifications
You must be signed in to change notification settings - Fork 0
205 lines (158 loc) · 5.82 KB
/
Copy pathci.yml
File metadata and controls
205 lines (158 loc) · 5.82 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
# ─── EditorConfig ──────────────────────────────────────────────────────────
editorconfig:
name: EditorConfig Compliance
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check EditorConfig compliance
uses: editorconfig-checker/action-editorconfig-checker@main
# ─── Frontend Type Check (required gate) ───────────────────────────────────
frontend-typecheck:
name: Frontend Type Check
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Type check
run: npm run type-check
# ─── Frontend ──────────────────────────────────────────────────────────────
frontend:
name: Frontend (Next.js)
runs-on: ubuntu-latest
needs: frontend-typecheck
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Check for unused dependencies
run: npx depcheck --ignores="@storybook/*,prettier" --ignore-dirs=.next,.storybook
- name: Lint
run: npm run lint
- name: Unit tests
run: npm test
- name: Build
run: npm run build
env:
NEXT_PUBLIC_STELLAR_NETWORK: testnet
NEXT_PUBLIC_HORIZON_URL: https://horizon-testnet.stellar.org
NEXT_PUBLIC_API_URL: http://localhost:4000
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_RELEASE: ${{ github.sha }}
- name: Build Storybook (dev-only docs bundle)
run: npm run build-storybook
- name: Bundle size budget
run: npm run size
# ─── Backend ───────────────────────────────────────────────────────────────
backend:
name: Backend (Node.js)
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"
cache-dependency-path: backend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Check for unused dependencies
run: npx depcheck
- name: Lint
run: npm run lint
- name: Unit tests
run: npm test
# ─── Contracts ─────────────────────────────────────────────────────────────
contracts:
name: Soroban Contracts (Rust)
runs-on: ubuntu-latest
defaults:
run:
working-directory: contracts/stellar-micropay-contract
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check
run: cargo check --target wasm32-unknown-unknown
- name: Test
run: cargo test
- name: Build WASM
run: cargo build --target wasm32-unknown-unknown --release
- name: Install Syft
uses: anchore/sbom-action/download-syft@v0
- name: Generate and verify contract SBOM (#817)
working-directory: contracts/stellar-micropay-contract
run: |
syft scan dir:. -o cyclonedx-json=../../contract-sbom.cyclonedx.json
test -s ../../contract-sbom.cyclonedx.json
test -f ../../target/wasm32-unknown-unknown/release/stellar_micropay_contract.wasm
# ─── E2E Tests ─────────────────────────────────────────────────────────────
e2e:
name: E2E Tests (Playwright)
runs-on: ubuntu-latest
needs: frontend-typecheck
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Run E2E tests
run: npm run test:e2e
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: frontend/playwright-report/