Skip to content

Commit 60744a3

Browse files
committed
ci: add simple GitHub actions vectorlint CI
Ensures the Go code remains nicely formatted, that `go mod tidy` has been run, that the code builds without error, and that the `vectorlint` tool finds no issues.
1 parent c44de18 commit 60744a3

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/vectorlint.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Vector Lint
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
pull_request:
9+
10+
jobs:
11+
build:
12+
name: Lint vectors/schemas
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check out code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version-file: go.mod
22+
23+
- name: Check if modules are tidy
24+
run: |
25+
go mod tidy
26+
if [ -n "$(git status --porcelain go.mod go.sum)" ]; then
27+
echo "go.mod or go.sum are not tidy. Please run 'go mod tidy' locally and commit changes."
28+
git diff go.mod go.sum
29+
exit 1
30+
fi
31+
32+
- name: Verify formatting
33+
# 'gofmt -l .' to list files whose formatting differs from gofmt's
34+
# 'test -z' to verify that the output is empty
35+
run: test -z "$(gofmt -l .)"
36+
37+
- name: Run vectorlint
38+
run: go run ./tools/vectorlint

0 commit comments

Comments
 (0)