mirror of
https://github.com/GoTestTools/gotestfmt-action.git
synced 2026-02-07 16:27:27 +00:00
Readme
This commit is contained in:
parent
8a47082a5b
commit
60528c590c
1 changed files with 51 additions and 0 deletions
51
README.md
51
README.md
|
|
@ -0,0 +1,51 @@
|
|||
# Beautiful test output for go tests
|
||||
|
||||
This action uses [gotestfmt](https://github.com/haveyoudebuggedit/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: haveyoudebuggedit/gotestfmt-action@v1
|
||||
with:
|
||||
# Optional: pass GITHUB_TOKEN to avoid rate limiting.
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Optional: pass the gotestfmt version you want to run.
|
||||
version: v1.0.0
|
||||
# Optional: pass an organization name and repo to use a fork
|
||||
org: haveyoudebuggedit
|
||||
repo: gotestfmt
|
||||
|
||||
# Run tests with nice formatting. Save the original log in /tmp/gotest.log
|
||||
- name: Run tests
|
||||
run: go test -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/haveyoudebuggedit/gotestfmt) repository.
|
||||
Loading…
Reference in a new issue