-
Notifications
You must be signed in to change notification settings - Fork 272
42 lines (34 loc) · 985 Bytes
/
ci.yml
File metadata and controls
42 lines (34 loc) · 985 Bytes
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
name: Continuous Integration
on: pull_request
jobs:
module:
name: Module build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ['1.23', '1.24']
steps:
- name: Check out code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ${{ matrix.go }}
- name: Install golint
run: go install golang.org/x/lint/golint@latest
- name: Run Linter
run: |
golint -set_exit_status ./...
- name: Run Unit Tests
if: success() || failure()
run: go test -v -race -test.short ./...
- name: Run Formatter
run: |
if [[ ! -z "$(gofmt -l -s .)" ]]; then
echo "Go code is not formatted:"
gofmt -d -s .
exit 1
fi
- name: Run Static Analyzer
run: go vet -v ./...