-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.46 KB
/
ci.yml
File metadata and controls
59 lines (49 loc) · 1.46 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
name: CI
on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
jobs:
test:
name: Test (${{ matrix.os }}, Go ${{ matrix.go }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go: ['1.26']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache-dependency-path: go.sum
- name: Generate
run: go generate ./...
- name: Verify generated files are committed
run: git diff --exit-code
- name: Build
run: go build -v ./...
- name: Test
run: go test -v -count=1 ./...
- name: Race
run: go test -v -race -count=1 ./...
- name: Coverage
if: matrix.os == 'ubuntu-latest'
run: |
go test -count=1 -coverpkg=./processors/... -coverprofile=coverage.out ./tests/...
COVERAGE=$(go tool cover -func=coverage.out | awk '/^total:/ {gsub("%","",$3); print $3}')
echo "Total coverage: ${COVERAGE}%"
awk -v c="$COVERAGE" 'BEGIN { if (c+0 < 75) { exit 1 } }'
- name: GoReleaser config check
if: matrix.os == 'ubuntu-latest'
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: check