You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
⚠️Action required: gotestfmt has moved to the GoTestTools organization and you need to update your references. Please see the announcement. The old repository will be deleted on January 1, 2023.
This action uses gotestfmt to create a beautifully formatted test output in GitHub Actions.
Usage
You can use gotestfmt with the following configuration:
jobs:
build:
name: Testruns-on: ubuntu-lateststeps:
# Checkout your project with git
- name: Checkoutuses: actions/checkout@v2# Install Go on the VM running the action.
- name: Set up Gouses: actions/setup-go@v2with:
go-version: 1.16# Install gotestfmt on the VM running the action.
- name: Set up gotestfmtuses: GoTestTools/gotestfmt-action@v2with:
# 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 forkorg: GoTestToolsrepo: gotestfmt# Run tests with nice formatting. Save the original log in /tmp/gotest.log
- name: Run testsrun: | 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 loguses: actions/upload-artifact@v2if: always()with:
name: test-logpath: /tmp/gotest.logif-no-files-found: error
For more information about gotestfmt please see the gotestfmt repository.