Skip to content

Commit e347a66

Browse files
committed
ci(github): add CI workflow for build, test, and lint
1 parent 4ad64c5 commit e347a66

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+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build-and-test:
11+
name: Build, Lint & Test
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: '1.22'
22+
cache: true
23+
24+
- name: Verify dependencies
25+
run: go mod verify
26+
27+
- name: Run go vet
28+
run: go vet ./...
29+
30+
- name: Build
31+
run: go build -v ./...
32+
33+
- name: Run tests
34+
run: go test -race -coverprofile=coverage.out ./...
35+
36+
- name: Upload coverage
37+
uses: codecov/codecov-action@v4
38+
with:
39+
file: coverage.out
40+
fail_ci_if_error: false
41+
42+
lint:
43+
name: Lint
44+
runs-on: ubuntu-latest
45+
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v4
49+
50+
- name: Set up Go
51+
uses: actions/setup-go@v5
52+
with:
53+
go-version: '1.22'
54+
cache: true
55+
56+
- name: Run golangci-lint
57+
uses: golangci/golangci-lint-action@v6
58+
with:
59+
version: latest

0 commit comments

Comments
 (0)