add github action for go test #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go Test Report | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: 1.24 | |
- name: Install gotestsum | |
run: go install gotest.tools/gotestsum@latest | |
- name: Run tests and generate report | |
run: | | |
mkdir -p test-report | |
$(go env GOPATH)/bin/gotestsum --junitfile test-report/report.xml --format standard-verbose ./... | |
- name: Upload test report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: go-test-report | |
path: test-report/report.xml | |
- name: Publish Test Results to GitHub UI | |
uses: mikepenz/action-junit-report@v4 | |
with: | |
report_paths: 'test-report/*.xml' |