Skip to content

Commit 9ab16b3

Browse files
committed
Add probe module workflow
1 parent 211cde2 commit 9ab16b3

File tree

1 file changed

+134
-0
lines changed

1 file changed

+134
-0
lines changed

.github/workflows/probe.yml

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: check-probe
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
paths:
8+
- "probe/**"
9+
- ".github/workflows/probe.yml"
10+
pull_request:
11+
branches:
12+
- "*"
13+
paths:
14+
- "probe/**"
15+
- ".github/workflows/probe.yml"
16+
17+
jobs:
18+
19+
clean:
20+
name: clean
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 2
23+
strategy:
24+
matrix:
25+
go: [stable]
26+
fail-fast: true
27+
steps:
28+
- name: Checkout repo
29+
uses: actions/checkout@v4
30+
- name: Set up Go
31+
uses: actions/setup-go@v5
32+
with:
33+
go-version: ${{ matrix.go }}
34+
cache: true
35+
- name: Run go mod tidy
36+
working-directory: probe
37+
run: go mod tidy && git diff --exit-code
38+
- name: Run go mod verify
39+
working-directory: probe
40+
run: go mod verify
41+
- name: Run formatting
42+
working-directory: probe
43+
run: go run golang.org/x/tools/cmd/goimports@latest -w . && git diff --exit-code
44+
45+
lint:
46+
name: lint
47+
runs-on: ubuntu-latest
48+
timeout-minutes: 4
49+
strategy:
50+
matrix:
51+
go: [stable]
52+
fail-fast: true
53+
steps:
54+
- name: Checkout repo
55+
uses: actions/checkout@v4
56+
- name: Set up Go
57+
uses: actions/setup-go@v5
58+
with:
59+
go-version: ${{ matrix.go }}
60+
cache: true
61+
- name: Run go linting
62+
uses: golangci/golangci-lint-action@v4
63+
with:
64+
version: latest
65+
args: --timeout=4m
66+
working-directory: probe
67+
68+
test:
69+
name: test
70+
runs-on: ubuntu-latest
71+
timeout-minutes: 2
72+
strategy:
73+
matrix:
74+
go: [stable]
75+
fail-fast: true
76+
steps:
77+
- name: Checkout repo
78+
uses: actions/checkout@v4
79+
- name: Set up Go
80+
uses: actions/setup-go@v5
81+
with:
82+
go-version: ${{ matrix.go }}
83+
cache: true
84+
- name: Run tests
85+
working-directory: probe
86+
run: go test -shuffle=on -v -count=1 -race -failfast -timeout=30s -covermode=atomic -coverprofile=coverage.out ./...
87+
- name: Codecov Coverage
88+
uses: codecov/codecov-action@v4
89+
with:
90+
token: ${{ secrets.CODECOV_TOKEN }}
91+
working-directory: probe
92+
93+
benchmark:
94+
name: benchmark
95+
runs-on: ubuntu-latest
96+
timeout-minutes: 2
97+
strategy:
98+
matrix:
99+
go: [stable]
100+
fail-fast: true
101+
steps:
102+
- name: Checkout repo
103+
uses: actions/checkout@v4
104+
- name: Set up Go
105+
uses: actions/setup-go@v5
106+
with:
107+
go-version: ${{ matrix.go }}
108+
cache: true
109+
- name: Run benchmarks
110+
working-directory: probe
111+
run: go test -v -shuffle=on -run=- -bench=. -benchtime=1x -timeout=10s ./...
112+
113+
build:
114+
name: build
115+
runs-on: ubuntu-latest
116+
timeout-minutes: 4
117+
strategy:
118+
matrix:
119+
go: [stable]
120+
fail-fast: true
121+
steps:
122+
- name: Checkout repo
123+
uses: actions/checkout@v4
124+
- name: Set up Go
125+
uses: actions/setup-go@v5
126+
with:
127+
go-version: ${{ matrix.go }}
128+
cache: true
129+
- name: Run go generate
130+
working-directory: probe
131+
run: go generate ./... && git diff --exit-code
132+
- name: Run go build
133+
working-directory: probe
134+
run: go build -o /dev/null ./...

0 commit comments

Comments
 (0)