Skip to content

Commit 8a4d50d

Browse files
committed
ci: add tests + coverage workflow
Runs go test -race -coverprofile across all packages on push and PR. Checks out web4 and all sibling deps so replace directives resolve. Coverage uploaded as a 30-day artifact.
1 parent acb8081 commit 8a4d50d

2 files changed

Lines changed: 153 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout this repo
17+
uses: actions/checkout@v4
18+
with:
19+
path: libpilot
20+
21+
- name: Checkout web4
22+
uses: actions/checkout@v4
23+
with:
24+
repository: TeoSlayer/pilotprotocol
25+
path: web4
26+
27+
- name: Checkout common
28+
uses: actions/checkout@v4
29+
with:
30+
repository: pilot-protocol/common
31+
ref: v0.1.0
32+
path: common
33+
34+
- name: Checkout app-store
35+
uses: actions/checkout@v4
36+
with:
37+
repository: pilot-protocol/app-store
38+
ref: v0.1.0
39+
path: app-store
40+
41+
- name: Checkout trustedagents
42+
uses: actions/checkout@v4
43+
with:
44+
repository: pilot-protocol/trustedagents
45+
ref: v0.1.0
46+
path: trustedagents
47+
48+
- name: Checkout skillinject
49+
uses: actions/checkout@v4
50+
with:
51+
repository: pilot-protocol/skillinject
52+
ref: v0.1.0
53+
path: skillinject
54+
55+
- name: Checkout webhook
56+
uses: actions/checkout@v4
57+
with:
58+
repository: pilot-protocol/webhook
59+
ref: v0.1.0
60+
path: webhook
61+
62+
- name: Checkout eventstream
63+
uses: actions/checkout@v4
64+
with:
65+
repository: pilot-protocol/eventstream
66+
ref: v0.1.0
67+
path: eventstream
68+
69+
- name: Checkout dataexchange
70+
uses: actions/checkout@v4
71+
with:
72+
repository: pilot-protocol/dataexchange
73+
ref: v0.1.0
74+
path: dataexchange
75+
76+
- name: Checkout updater
77+
uses: actions/checkout@v4
78+
with:
79+
repository: pilot-protocol/updater
80+
ref: v0.1.0
81+
path: updater
82+
83+
- name: Checkout gateway
84+
uses: actions/checkout@v4
85+
with:
86+
repository: pilot-protocol/gateway
87+
ref: v0.1.0
88+
path: gateway
89+
90+
- name: Checkout nameserver
91+
uses: actions/checkout@v4
92+
with:
93+
repository: pilot-protocol/nameserver
94+
ref: v0.1.0
95+
path: nameserver
96+
97+
- name: Checkout policy
98+
uses: actions/checkout@v4
99+
with:
100+
repository: pilot-protocol/policy
101+
ref: v0.1.0
102+
path: policy
103+
104+
- name: Checkout handshake
105+
uses: actions/checkout@v4
106+
with:
107+
repository: pilot-protocol/handshake
108+
ref: v0.1.0
109+
path: handshake
110+
111+
- name: Checkout runtime
112+
uses: actions/checkout@v4
113+
with:
114+
repository: pilot-protocol/runtime
115+
ref: v0.1.0
116+
path: runtime
117+
118+
- name: Checkout rendezvous
119+
uses: actions/checkout@v4
120+
with:
121+
repository: pilot-protocol/rendezvous
122+
ref: v0.1.0
123+
path: rendezvous
124+
125+
- name: Checkout beacon
126+
uses: actions/checkout@v4
127+
with:
128+
repository: pilot-protocol/beacon
129+
ref: v0.1.0
130+
path: beacon
131+
132+
- uses: actions/setup-go@v5
133+
with:
134+
go-version: '1.25'
135+
cache: true
136+
cache-dependency-path: libpilot/go.sum
137+
138+
- name: Run tests with coverage
139+
working-directory: libpilot
140+
run: go test -race -coverprofile=coverage.out -covermode=atomic ./...
141+
142+
- name: Coverage summary
143+
working-directory: libpilot
144+
run: go tool cover -func=coverage.out | tail -20
145+
146+
- uses: actions/upload-artifact@v4
147+
with:
148+
name: coverage-libpilot
149+
path: libpilot/coverage.out
150+
retention-days: 30

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ libpilot.dylib
22
libpilot.so
33
libpilot.dll
44
libpilot.h
5+
coverage.out
6+
*.test
7+
/libpilot

0 commit comments

Comments
 (0)