https://github.com/mcous/go-test-annotations
Add annotations from `go test` to your GitHub Actions workflow runs
https://github.com/mcous/go-test-annotations
Last synced: 9 months ago
JSON representation
Add annotations from `go test` to your GitHub Actions workflow runs
- Host: GitHub
- URL: https://github.com/mcous/go-test-annotations
- Owner: mcous
- Created: 2025-03-29T23:53:28.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-30T00:10:35.000Z (about 1 year ago)
- Last Synced: 2025-03-30T01:23:06.262Z (about 1 year ago)
- Language: TypeScript
- Size: 511 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go test annotations
Add annotations from `go test` and `gotestsum` to a GitHub Actions workflow run.
## Usage
### `go test`
```yaml
on:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v5
with:
go-version: '1.24'
- run: go test -json ./... > test.json
- if: ${{ !cancelled() }
uses: mcous/go-test-annotations@v1
with:
test-report: test.json
```
### `gotestsum`
```yaml
on:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v5
with:
go-version: '1.24'
- run: gotestsum --jsonfile=test.json --rerun-fails ---rerun-fails-report=rerun-fails.txt --packages=./...
- if: ${{ !cancelled() }
uses: mcous/go-test-annotations@v1
with:
test-report: test.json
rerun-fails-report: rerun-fails.txt
```
## Options
```yaml
- uses: mcous/go-test-annotations@v1
with:
test-report: test.json
rerun-fails-report: rerun-fails.txt
```
| name | default | description |
| -------------------- | ----------- | ---------------------------------------------------- |
| `test-report` | `test.json` | Path to test report file from `go test -json` |
| `rerun-fails-report` | N/A | Path to re-run report from `gotestsum --rerun-fails` |