-
Notifications
You must be signed in to change notification settings - Fork 1
94 lines (77 loc) · 2.3 KB
/
Copy pathci.yml
File metadata and controls
94 lines (77 loc) · 2.3 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
name: ci
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- name: Install coverage provider
run: npm install --no-save @vitest/coverage-v8@^3.0.0
- name: Run tests
run: npx vitest run --coverage
continue-on-error: true
- name: Coverage summary
if: always()
run: |
if [ -d coverage ]; then
ls coverage/
cat coverage/coverage-summary.json 2>/dev/null || true
fi
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
if: always()
with:
directory: ./coverage
flags: unittests
name: sdk-node
fail_ci_if_error: false
- uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-sdk-node
path: coverage/
retention-days: 30
if-no-files-found: ignore
# Builds libpilot from source and runs loadLibrary() against it. koffi
# throws on the first symbol it cannot resolve, so this is the only job
# that notices when the SDK's binding list and libpilot's exports drift
# apart — every other test substitutes a fake library object.
ffi-smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: sdk-node
- uses: actions/checkout@v4
with:
repository: pilot-protocol/libpilot
path: libpilot
- uses: actions/setup-go@v5
with:
go-version: '1.25'
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Build libpilot
working-directory: libpilot
run: CGO_ENABLED=1 go build -buildmode=c-shared -o libpilot.so .
- name: Install deps
working-directory: sdk-node
run: npm ci
- name: Resolve FFI symbols against the freshly built library
working-directory: sdk-node
env:
PILOT_LIB_PATH: ${{ github.workspace }}/libpilot/libpilot.so
PILOT_REQUIRE_LIB: '1'
run: npx vitest run tests/ffi_smoke.test.ts