-
Notifications
You must be signed in to change notification settings - Fork 4
101 lines (82 loc) · 2.04 KB
/
Copy pathci.yml
File metadata and controls
101 lines (82 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.26.4'
- name: Run golangci-lint
uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0
with:
version: v2.12.2
checks:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.26.4'
- name: Check formatting
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "The following files are not gofmt-formatted:"
echo "$unformatted"
exit 1
fi
- name: Verify go.mod/go.sum are tidy
run: |
go mod tidy
git diff --exit-code go.mod go.sum
- name: go vet
run: go vet ./...
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.26.4'
- name: Setup CI environment
run: ./scripts/ci-setup.sh
- name: Run tests (race detector + coverage)
run: go test -race -covermode=atomic -coverprofile=coverage.out ./...
- name: Upload coverage report
uses: actions/upload-artifact@v7
with:
name: coverage
path: coverage.out
if-no-files-found: ignore
integration:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.26.4'
- name: Run integration tests (testcontainers/Postgres)
run: go test -tags=integration -race ./...