-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (68 loc) · 2.76 KB
/
Copy pathci.yml
File metadata and controls
78 lines (68 loc) · 2.76 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Build & Test (Node ${{ matrix.node }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ["20", "22"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
- name: Install dependencies
# --legacy-peer-deps because @kamino-finance/kliquidity-sdk (a transitive
# dep of @kamino-finance/klend-sdk) declares peer @solana/kit@^3.0 while
# klend-sdk itself uses @solana/kit@^2.3. Nesting (kit v2 hoisted, kit v3
# under kliquidity-sdk's local node_modules) is the right resolution —
# the two SDKs use independent APIs of kit. Strict resolution refuses the
# nest and would force us to wait for upstream alignment.
run: npm ci --legacy-peer-deps
- name: Typecheck & build
run: npm run build
- name: Lint
run: npm run lint
- name: Run tests
run: npm test
- name: "Guard: no focused (.only) tests"
# Matches it/test/describe .only in any chain position (.only, .only.each,
# .concurrent.only, .only.concurrent). Line-based grep won't catch a chain
# split across newlines — migrate to eslint-plugin-vitest no-only-tests if
# #714 lands an ESLint config.
run: |
set +e
matches=$(grep -rEn '\b(it|describe|test)(\.\w+)*\.only\b' test/)
rc=$?
set -e
case "$rc" in
0) printf '%s\n' "$matches"
echo "::error::Focused (.only) test(s) found in test/ — remove before merging."
exit 1 ;;
1) : ;; # no match — clean
*) echo "::error::.only guard: grep exited $rc (error) — failing closed."
exit 1 ;;
esac
# Note: a `binary-smoke-test` job lived here that built the linux-x64
# pkg-bundled binary on every PR and ran scripts/smoke-test-binary.mjs
# against it. It was the per-PR catch for pkg-bundle startup
# regressions like issue #330 (await import() tripping
# ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING inside the snapshot). Removed
# as a CI cost reduction — the same smoke test still runs in
# release-binaries.yml for every release artifact (linux + macOS +
# Windows), so a pkg-bundle regression still gets caught before users
# see it; it just lands on main first and surfaces at the next release
# cut instead of at PR-review time. Restore this job if pkg-bundle
# regressions start making it to release-time again.