Skip to content

Warning

You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?

Go Test Action

Actions
Run go test with rich summary output and annotations
v0.2.0
Star (44)

go-test-action

GitHub Action for running go test ... and getting rich summary and annotations as output.

Powered by Job Summaries, this Action will generate a convenient interactive viewer for tests based on Go's test2json output. If there are any errors during go test, the Action will report back the same exit code, which will fail the job.

Inputs

Input Default Description
moduleDirectory . relative path to the directory containing the go.mod of the module you wish to test
testArguments ./... arguments to pass to go test, -json will be prepended automatically
omitUntestedPackages false omit any go packages that don't have any tests from the summary output
omitPie false omit the pie chart from the summary output

Demo

Tests are organized per package, with a brief summary of individual test results:

summary overview

Expand for per-test (with subtest) results and to view raw test output:

summary expanded

Example workflow

name: Go

on:
  push:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3

    - name: Set up Go
      uses: actions/setup-go@v3
      with:
        go-version: 1.18

    - name: Build
      run: go build -v ./...

    - name: Test
      uses: robherley/go-test-action@v0.1.0

Go Test Action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Run go test with rich summary output and annotations
v0.2.0

Go Test Action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.