Skip to content

Commit 2dd8ade

Browse files
authored
ci: add GitHub Actions pipeline (tests, vet) across all workspace modules (#10)
Add .github/workflows/ci.yaml running on pull_request and push to main. The workflow installs the mise-pinned toolchain (Go 1.26.3) and runs the same mise tasks used locally — `mise run vet` (new task fanning out over every go.work module) and `mise run test` with GOFLAGS=-race — so CI and local dev cannot drift. Actions are pinned by commit SHA. Add a CI status badge to README.md. Closes #5 --- _Generated with [`mux`](https://github.com/coder/mux) • Model: `anthropic:claude-fable-5` • Thinking: `xhigh`_
1 parent 5c7494c commit 2dd8ade

4 files changed

Lines changed: 57 additions & 0 deletions

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
14+
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 30
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
22+
23+
- name: Install mise-pinned toolchain
24+
uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0
25+
26+
- name: Cache Go modules
27+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
28+
with:
29+
path: |
30+
~/go/pkg/mod
31+
~/.cache/go-build
32+
key: go-${{ runner.os }}-${{ hashFiles('**/go.sum', 'go.work.sum') }}
33+
restore-keys: go-${{ runner.os }}-
34+
35+
- name: Vet
36+
run: mise run vet
37+
38+
- name: Test
39+
run: mise run test
40+
env:
41+
GOFLAGS: -race

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Chat SDK Go
22

3+
[![CI](https://github.com/coder/chat/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/coder/chat/actions/workflows/ci.yaml)
4+
35
Chat SDK Go is a Go-native semantic subset of Vercel Chat SDK's
46
conversation runtime: adapters, normalized events, threads, subscriptions,
57
state-backed dedupe, and thread-scoped replies.

‎go.work.sum‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8=
3232
golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs=
3333
golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
3434
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
35+
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
3536
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
3637
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
3738
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
@@ -41,6 +42,7 @@ golang.org/x/telemetry v0.0.0-20260409153401-be6f6cb8b1fa/go.mod h1:kHjTxDEnAu6/
4142
golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk=
4243
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
4344
golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=
45+
golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc=
4446
golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38=
4547
golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
4648
golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0=

‎mise.toml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ run = "cd state/redis && go test ./..."
4343
description = "Run tests for the root Go module"
4444
run = "go test ./..."
4545

46+
[tasks.vet]
47+
description = "Run go vet for every Go module in the workspace"
48+
run = [
49+
"go vet ./...",
50+
"cd state/nats && go vet ./...",
51+
"cd state/postgres && go vet ./...",
52+
"cd state/redis && go vet ./...",
53+
"cd examples/slack-nats-state && go vet ./...",
54+
"cd examples/slack-redis-state && go vet ./...",
55+
"cd examples/slack-postgres-state && go vet ./...",
56+
]
57+
4658
[tasks."test:examples"]
4759
description = "Run example module tests"
4860
run = [

0 commit comments

Comments
 (0)