Skip to content

Commit e50724b

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 fix: remove branch restrictions for pull_request events in CI workflow forgot we don't push to main, my bad. if we had a dev branch I could filter it to only run on main and dev but since the "dev" branch changes every release let's just run it everywhere fix: specify cache-dependency-path fix: add concurrency settings to CI workflow only one run at a time per ref
1 parent 223ae9e commit e50724b

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/ci.yaml

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

0 commit comments

Comments
 (0)