GitHub Action for gotestfmt
Find a file
Yuri Norwood 5b56c00cec
Apply suggestions from code review
Signed-off-by: Yuri Norwood <106889957+norwd@users.noreply.github.com>
2022-11-03 09:51:49 +13:00
.github Apply suggestions from code review 2022-11-03 09:51:49 +13:00
node_modules Referencing the new organization 2022-10-08 16:28:19 +02:00
testdata Referencing the new organization 2022-10-08 16:28:19 +02:00
.gitignore Testing actions 2021-07-28 08:24:31 +02:00
action.yml Updating to node16 (#6) 2022-10-20 16:23:59 +02:00
index.js determining os 2022-10-20 08:33:23 +01:00
LICENSE.md Create LICENSE.md 2021-07-28 07:36:49 +00:00
package-lock.json Referencing the new organization 2022-10-08 16:28:19 +02:00
package.json Referencing the new organization 2022-10-08 16:28:19 +02:00
README.md Adding action required section 2022-10-09 09:27:47 +02:00

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. The old repository will be deleted on January 1, 2023.

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: 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 repository.