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
Copy file name to clipboardExpand all lines: README.md
+79-12Lines changed: 79 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,56 @@
1
1
# go-test-action
2
2
3
-
GitHub Action for running `go test ...` and getting rich summary and annotations as output.
3
+
-[go-test-action](#go-test-action)
4
+
-[Quick start](#quick-start)
5
+
-[Inputs](#inputs)
6
+
-[Screenshots](#screenshots)
7
+
-[Examples](#examples)
8
+
-[Basic](#basic)
9
+
-[Using existing test file](#using-existing-test-file)
10
+
-[Omitting elements](#omitting-elements)
11
+
12
+
GitHub Action for running `go test ./...` and getting rich summary and annotations as output.
4
13
5
14
Powered by [Job Summaries](https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/), this Action will generate a convenient interactive viewer for tests based on Go's [test2json](https://pkg.go.dev/cmd/test2json) output. If there are any errors during `go test`, the Action will report back the same exit code, which will fail the job.
6
15
16
+
## Quick start
17
+
18
+
```yaml
19
+
- name: Test
20
+
uses: robherley/go-test-action@v0
21
+
```
22
+
7
23
## Inputs
8
24
9
-
| Input | Default | Description |
10
-
| - | - | - |
11
-
| moduleDirectory |`.`| relative path to the directory containing the `go.mod` of the module you wish to test |
12
-
| testArguments |`./...`| arguments to pass to `go test`, `-json` will be prepended automatically |
13
-
| fromJSONFile | null | parse an exisiting [test2json](https://pkg.go.dev/cmd/test2json) file, instead of executing go test |
14
-
| omitUntestedPackages |`false`| omit any go packages that don't have any tests from the summary output |
15
-
| omitSuccessfulPackages |`false`| omit any go packages that didn't contain failed tests |
16
-
| omitPie | `false` | omit the pie chart from the summary output
25
+
```yaml
26
+
- uses: robherley/go-test-action@v0
27
+
with:
28
+
# Relative path to the directory containing the go.mod of the module you wish to test.
29
+
# Optional. Default is '.'
30
+
moduleDirectory:
31
+
32
+
# Arguments to pass to go test, -json will be prepended automatically.
33
+
# Optional. Default is './...'
34
+
testArguments:
35
+
36
+
# Parse an exisiting [test2json](https://pkg.go.dev/cmd/test2json) file, instead of executing go test.
37
+
# Will always exit(0) on successful test file parse.
38
+
# Optional. No default
39
+
fromJSONFile:
40
+
41
+
# Whitespace separated list of renderable items to omit.
42
+
# Valid options to omit are:
43
+
# untested: packages that have no tests
44
+
# successful: packages that are successful
45
+
# pie: mermaid.js pie chart
46
+
# pkg-tests: per-package test list
47
+
# pkg-output: per-package test output
48
+
# stderr: standard error output of `go test` subprocess
49
+
# Optional. No default
50
+
omit:
51
+
```
17
52
18
-
## Demo
53
+
## Screenshots
19
54
20
55
Tests are organized per package, with a brief summary of individual test results:
21
56
@@ -25,7 +60,9 @@ Expand for per-test (with subtest) results and to view raw test output:
0 commit comments