Skip to content

Commit 0e6a146

Browse files
feat: add a basic CI script
This just makes sure the code compiles and passes some static analysis, doesn't run the tests since a lot of them hang on my system
1 parent 223ae9e commit 0e6a146

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI (lints, tests (todo), and builds)
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
setup-build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Go
18+
uses: actions/setup-go@v4
19+
with:
20+
go-version: 1.22
21+
22+
- name: Verify dependencies
23+
run: go mod verify
24+
working-directory: src
25+
26+
- name: Install dependencies
27+
run: go mod tidy
28+
working-directory: src
29+
30+
- name: Build
31+
run: go build ./...
32+
working-directory: src
33+
34+
- name: Lint code (go vet)
35+
run: go vet ./...
36+
working-directory: src
37+
38+
- name: install staticcheck
39+
run: go install honnef.co/go/tools/cmd/staticcheck@latest
40+
working-directory: src
41+
42+
- name: Lint code (staticcheck)
43+
run: staticcheck ./...
44+
working-directory: src
45+
46+
# - name: Run tests # on my machine, the tests hang, so I'm not running them here yet
47+
# run: go test ./...

0 commit comments

Comments
 (0)