Skip to content

Commit 775f7c5

Browse files
committed
ci: GitHub Actions workflow (mirrors lantern's setup)
Per-push CI on ubuntu-latest. Same four checks: vet, build, test (race), gofmt. Configured to handle private Reiers/lantern dep via the LANTERN_RO_TOKEN secret (needs to be set on the repo before the workflow can pass). Note: until LANTERN_RO_TOKEN is set as a repo secret, CI will fail on the 'go vet' / 'go build' / 'go test' steps because go mod fetch can't resolve Reiers/lantern without auth. Setting the secret is a one-time manual step.
1 parent 94348ee commit 775f7c5

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Per-push CI for curio-core. Runs on every push to main + every PR.
2+
# Mirrors Reiers/lantern's CI workflow.
3+
4+
name: ci
5+
6+
on:
7+
push:
8+
branches: [main]
9+
pull_request:
10+
11+
jobs:
12+
build-test:
13+
name: build + test + vet + fmt
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 10
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: '1.25.x'
24+
cache: true
25+
26+
- name: Configure git for private Reiers deps
27+
env:
28+
GH_TOKEN: ${{ secrets.LANTERN_RO_TOKEN }}
29+
run: |
30+
if [ -n "$GH_TOKEN" ]; then
31+
git config --global url."https://x-access-token:${GH_TOKEN}@github.com/".insteadOf "https://github.com/"
32+
fi
33+
34+
- name: go vet
35+
env:
36+
GOPRIVATE: github.com/Reiers/*
37+
run: go vet ./...
38+
39+
- name: go build
40+
env:
41+
CGO_ENABLED: '0'
42+
GOPRIVATE: github.com/Reiers/*
43+
run: go build ./...
44+
45+
- name: go test
46+
env:
47+
CGO_ENABLED: '1' # race detector
48+
GOPRIVATE: github.com/Reiers/*
49+
run: go test -race -timeout 5m ./...
50+
51+
- name: gofmt
52+
run: |
53+
set -e
54+
drift="$(gofmt -l .)"
55+
if [ -n "$drift" ]; then
56+
echo "::error::gofmt drift detected:"
57+
echo "$drift"
58+
exit 1
59+
fi

0 commit comments

Comments
 (0)