Skip to content

Commit a09a0c1

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 63c000c commit a09a0c1

2 files changed

Lines changed: 134 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
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: runtime
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 handshake
35+
uses: actions/checkout@v4
36+
with:
37+
repository: pilot-protocol/handshake
38+
ref: v0.1.0
39+
path: handshake
40+
41+
- name: Checkout policy
42+
uses: actions/checkout@v4
43+
with:
44+
repository: pilot-protocol/policy
45+
ref: v0.1.0
46+
path: policy
47+
48+
- name: Checkout app-store
49+
uses: actions/checkout@v4
50+
with:
51+
repository: pilot-protocol/app-store
52+
ref: v0.1.0
53+
path: app-store
54+
55+
- name: Checkout trustedagents
56+
uses: actions/checkout@v4
57+
with:
58+
repository: pilot-protocol/trustedagents
59+
ref: v0.1.0
60+
path: trustedagents
61+
62+
- name: Checkout skillinject
63+
uses: actions/checkout@v4
64+
with:
65+
repository: pilot-protocol/skillinject
66+
ref: v0.1.0
67+
path: skillinject
68+
69+
- name: Checkout webhook
70+
uses: actions/checkout@v4
71+
with:
72+
repository: pilot-protocol/webhook
73+
ref: v0.1.0
74+
path: webhook
75+
76+
- name: Checkout eventstream
77+
uses: actions/checkout@v4
78+
with:
79+
repository: pilot-protocol/eventstream
80+
ref: v0.1.0
81+
path: eventstream
82+
83+
- name: Checkout dataexchange
84+
uses: actions/checkout@v4
85+
with:
86+
repository: pilot-protocol/dataexchange
87+
ref: v0.1.0
88+
path: dataexchange
89+
90+
- name: Checkout updater
91+
uses: actions/checkout@v4
92+
with:
93+
repository: pilot-protocol/updater
94+
ref: v0.1.0
95+
path: updater
96+
97+
- name: Checkout gateway
98+
uses: actions/checkout@v4
99+
with:
100+
repository: pilot-protocol/gateway
101+
ref: v0.1.0
102+
path: gateway
103+
104+
- name: Checkout nameserver
105+
uses: actions/checkout@v4
106+
with:
107+
repository: pilot-protocol/nameserver
108+
ref: v0.1.0
109+
path: nameserver
110+
111+
- uses: actions/setup-go@v5
112+
with:
113+
go-version: '1.25'
114+
cache: true
115+
cache-dependency-path: runtime/go.sum
116+
117+
- name: Run tests with coverage
118+
working-directory: runtime
119+
run: go test -race -coverprofile=coverage.out -covermode=atomic ./...
120+
121+
- name: Coverage summary
122+
working-directory: runtime
123+
run: go tool cover -func=coverage.out | tail -20
124+
125+
- uses: actions/upload-artifact@v4
126+
with:
127+
name: coverage-runtime
128+
path: runtime/coverage.out
129+
retention-days: 30

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
coverage.out
2+
*.test
3+
*.dylib
4+
*.so
5+
*.dll

0 commit comments

Comments
 (0)