GitHub Action for gotestfmt
Find a file
2021-12-05 12:54:21 +00:00
.github Issue haveyoudebuggedit/gotestfmt#8: JSON support (#1) 2021-12-05 12:54:21 +00:00
node_modules Testing actions 2021-07-28 08:24:31 +02:00
testdata More testing 2021-07-28 09:28:17 +02:00
.gitignore Testing actions 2021-07-28 08:24:31 +02:00
action.yml Updated description 2021-07-28 09:42:01 +02:00
index.js Issue haveyoudebuggedit/gotestfmt#8: JSON support (#1) 2021-12-05 12:54:21 +00:00
LICENSE.md Create LICENSE.md 2021-07-28 07:36:49 +00:00
package-lock.json Testing actions 2021-07-28 08:24:31 +02:00
package.json Testing actions 2021-07-28 08:24:31 +02:00
README.md Issue haveyoudebuggedit/gotestfmt#8: JSON support (#1) 2021-12-05 12:54:21 +00:00

gotestfmt: go test output for humans

This action uses gotestfmt to create a beautifully formatted test output in GitHub Actions.

An animation showcasing that gotestfmt transforms a text log into an interactive log with folding sections.

Usage

You can use gotestfmt with the following configuration:

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@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: haveyoudebuggedit
          repo: gotestfmt

      # Run tests with nice formatting. Save the original log in /tmp/gotest.log
      - name: Run tests
        run: |
          set -euo pipefail
          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 repository.