-
Notifications
You must be signed in to change notification settings - Fork 67
166 lines (157 loc) · 5.26 KB
/
Copy pathci.yml
File metadata and controls
166 lines (157 loc) · 5.26 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
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
lint-typecheck:
name: Lint & Typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6.0.10
- uses: actions/setup-node@v7
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm format:check
- run: pnpm lint
- run: pnpm typecheck
# The Vercel serverless functions in api/ live outside the pnpm workspace,
# so turbo doesn't cover them — typecheck them explicitly.
- run: pnpm typecheck:api
- name: Verify apps/api-local build output is flat
run: |
pnpm --filter @meridian/api-local build
test -f apps/api-local/dist/index.js
vercel-build:
name: Verify Vercel Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6.0.10
- uses: actions/setup-node@v7
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Run the real Vercel build script
run: pnpm exec bash scripts/build-vercel.sh
- name: Assert every workspace package api/v1/* imports was bundled
run: |
for pkg in shared stellar-sdk-helpers api-core; do
if [ ! -f "packages/$pkg/dist/index.js" ]; then
echo "::error::packages/$pkg/dist/index.js was not produced by scripts/build-vercel.sh, but api/v1/* imports @meridian/$pkg. This is the exact failure mode from #398 (ERR_MODULE_NOT_FOUND in production)."
exit 1
fi
done
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6.0.10
- uses: actions/setup-node@v7
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm test
- run: pnpm coverage
commitlint:
name: Commit Messages
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v6
with:
configFile: commitlint.config.mjs
pr-lint:
name: PR Title
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
feat
fix
docs
chore
refactor
test
style
ci
perf
dependency-review:
name: Dependency Review
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v7
- uses: actions/dependency-review-action@v5
e2e:
name: E2E Tests
runs-on: ubuntu-latest
# Drives the real dev stack against real Stellar testnet RPC (wallet
# signing is mocked, see apps/web/e2e/fixtures.ts), so it exercises
# the real API and Soroban simulation paths end to end. Tests use page.route()
# to stub live-network-dependent data where it would otherwise be flaky on
# testnet RPC hiccups (see #535). Blocking.
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6.0.10
- uses: actions/setup-node@v7
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
# apps/api-local imports its workspace deps (@meridian/shared etc.) by
# package resolution, which needs their dist/ output built first - the
# dev server doesn't build them itself. Scoped to api-local's own
# dependency graph so this doesn't also try to build contracts/docs.
- run: pnpm exec turbo run build --filter=@meridian/api-local...
- run: pnpm --filter @meridian/web exec playwright install --with-deps chromium
- run: pnpm --filter @meridian/web test:e2e
contracts:
name: Soroban Contract Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
with:
workspaces: packages/contracts
- name: Check formatting
working-directory: packages/contracts
run: cargo fmt --all -- --check
- name: Run clippy
working-directory: packages/contracts
run: cargo clippy --all-targets -- -D warnings
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install LLVM coverage tools
run: rustup component add llvm-tools-preview
- name: Measure contract coverage
working-directory: packages/contracts
run: >-
cargo llvm-cov
--package meridian-vault
--package meridian-blend-adapter
--package meridian-defindex-adapter
--package adapter-common
--summary-only
--fail-under-lines 97.5
- name: Build wasm
working-directory: packages/contracts
run: cargo build --target wasm32-unknown-unknown --release