-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (47 loc) · 1.42 KB
/
main.yml
File metadata and controls
50 lines (47 loc) · 1.42 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
name: Build and Test
on:
push:
branches:
- main
pull_request:
jobs:
job_go_checks:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Go environment
uses: actions/setup-go@v5
with:
go-version: "1.24"
- name: Tidy go module
run: |
go mod tidy
if [[ $(git status --porcelain) ]]; then
git diff
echo
echo "go mod tidy made these changes, please run 'go mod tidy' and include those changes in a commit"
exit 1
fi
- name: Run gofumpt
run: diff -u <(echo -n) <(go run mvdan.cc/gofumpt@@latest -d .)
- name: Run go vet
run: go vet ./...
job_go_test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Go environment
uses: actions/setup-go@v5
with:
go-version: "1.24"
- name: Run Go test -race
run: go test ./... -v -race -timeout=1h