https://github.com/gotesttools/gotestfmt-action
GitHub Action for gotestfmt
https://github.com/gotesttools/gotestfmt-action
github-actions go golang testing
Last synced: 3 months ago
JSON representation
GitHub Action for gotestfmt
- Host: GitHub
- URL: https://github.com/gotesttools/gotestfmt-action
- Owner: GoTestTools
- License: mit
- Created: 2021-07-28T06:04:19.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-02-05T08:00:09.000Z (about 2 years ago)
- Last Synced: 2025-04-11T06:12:14.262Z (10 months ago)
- Topics: github-actions, go, golang, testing
- Language: JavaScript
- Homepage: https://github.com/GoTestTools/gotestfmt
- Size: 677 KB
- Stars: 10
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# gotestfmt: go test output for humans
> ⚠️ **Action required:** gotestfmt has moved to the `GoTestTools` organization and you need to update your references. Please see the [announcement](https://github.com/GoTestTools/gotestfmt/discussions/46). The old repository will be deleted on January 1, 2023.
This action uses [gotestfmt](https://github.com/GoTestTools/gotestfmt) to create a beautifully formatted test output in GitHub Actions.

## Usage
You can use gotestfmt with the following configuration:
```yaml
jobs:
build:
name: Test
runs-on: ubuntu-latest
steps:
# Checkout your project with git
- name: Checkout
uses: actions/checkout@v2
# Install Go on the VM running the action.
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
# Install gotestfmt on the VM running the action.
- name: Set up gotestfmt
uses: GoTestTools/gotestfmt-action@v2
with:
# Optional: pass GITHUB_TOKEN to avoid rate limiting.
token: ${{ secrets.GITHUB_TOKEN }}
# Optional: pass the gotestfmt version you want to run.
version: v2.0.0
# Optional: pass an organization name and repo to use a fork
org: GoTestTools
repo: gotestfmt
# Run tests with nice formatting. Save the original log in /tmp/gotest.log
- name: Run tests
run: |
set -euo pipefail
go test -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
# Upload the original go test log as an artifact for later review.
- name: Upload test log
uses: actions/upload-artifact@v2
if: always()
with:
name: test-log
path: /tmp/gotest.log
if-no-files-found: error
```
For more information about gotestfmt please see the [gotestfmt](https://github.com/GoTestTools/gotestfmt) repository.