Skip to content

Commit ab0ac42

Browse files
authored
add github action for go test
1 parent 75f2f20 commit ab0ac42

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/go.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Go Test Report
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-go@v5
12+
with:
13+
go-version: 1.24
14+
15+
- name: Install gotestsum
16+
run: go install gotest.tools/gotestsum@latest
17+
18+
- name: Run tests and generate report
19+
run: |
20+
mkdir -p test-report
21+
$(go env GOPATH)/bin/gotestsum --junitfile test-report/report.xml --format standard-verbose ./...
22+
23+
- name: Upload test report
24+
uses: actions/upload-artifact@v4
25+
with:
26+
name: go-test-report
27+
path: test-report/report.xml
28+
29+
- name: Publish Test Results to GitHub UI
30+
uses: mikepenz/action-junit-report@v4
31+
with:
32+
report_paths: 'test-report/*.xml'

0 commit comments

Comments
 (0)