Skip to content

Commit 66cc2e3

Browse files
committed
chore: setup ci
1 parent 417f8d4 commit 66cc2e3

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
lines changed

Diff for: .github/workflows/ci.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-22.04
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-go@v5
13+
with:
14+
go-version-file: ./go.mod
15+
- name: Test
16+
run: go test ./...
17+
18+
lint:
19+
runs-on: ubuntu-22.04
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-go@v5
23+
with:
24+
go-version-file: ./go.mod
25+
- name: golangci-lint
26+
uses: golangci/golangci-lint-action@v6
27+
with:
28+
version: v1.58

Diff for: .golangci.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
run:
2+
timeout: 5m
3+
tests: false

Diff for: Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ test:
44
go test -v $(PKG)
55
testw:
66
gow test $(PKG)
7+
lint:
8+
golangci-lint run
79
coverage:
810
go test -coverprofile=.coverage/coverage.out $(PKG)
911
go tool cover -html=.coverage/coverage.out -o .coverage/coverage.html
1012
fmt:
1113
go fmt $(PKG)
1214

13-
PHONY: test testw coverage fmt
15+
PHONY: test testw lint coverage fmt

Diff for: pkg/file/file_mgr_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
)
1010

1111
func TestNewFileMgr(t *testing.T) {
12-
t.Parallel()
1312
const (
1413
dbDir = "test"
1514
blockSize = 4096
@@ -30,7 +29,6 @@ func TestNewFileMgr(t *testing.T) {
3029
}
3130

3231
func TestFileMgr(t *testing.T) {
33-
t.Parallel()
3432
const (
3533
blockSize = 4096
3634
dbDir = "test"

0 commit comments

Comments
 (0)