-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (52 loc) · 1.53 KB
/
Copy pathchecker.yaml
File metadata and controls
65 lines (52 loc) · 1.53 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
name: Go CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: go-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26.x"
cache: true
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
# Upgraded version to support Go 1.25+ syntax parsing
version: v1.64.6
args: --timeout=5m
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26.x"
# Relying on setup-go's built-in cache handling is cleaner than actions/cache@v4
cache: true
- name: Install dependencies
run: go mod download
- name: Check formatting
# If running locally, make sure you've executed `gofmt -w .`
run: xargs -r gofmt -d < <(git ls-files '*.go')
# Cleaned up the diff check to ensure it doesn't flag untracked files weirdly
- name: Verify module tidiness
run: |
go mod tidy
git diff --exit-code go.mod go.sum
- name: Build
run: go build -v ./...
- name: Test with Coverage
run: go test -v -race -covermode=atomic -coverprofile=coverage.out ./...
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.out