Skip to content

Commit f444e0d

Browse files
committed
update readme
1 parent 68a0724 commit f444e0d

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

README.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

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

5-
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.
5+
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.
66

7-
## Example
7+
## Demo
8+
9+
To interact with an example, [check it out here](https://github.com/robherley/go-test-example/actions/runs/2647255176/attempts/1).
810

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

@@ -18,6 +20,32 @@ Expand for per-test (with subtest) results and to view raw test output:
1820

1921
- `moduleDirectory` (optional): relative path to the directory containing the `go.mod` of the module you wish to test
2022
- Default: `.`
21-
- `testArguments` (optional): arguments to pass to `go test`, `-json` will be prepended
23+
- `testArguments` (optional): arguments to pass to `go test`, `-json` will be prepended automatically
2224
- Default: `./...`
2325

26+
## Example workflow
27+
28+
```yaml
29+
name: Go
30+
31+
on:
32+
push:
33+
34+
jobs:
35+
test:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v3
39+
40+
- name: Set up Go
41+
uses: actions/setup-go@v3
42+
with:
43+
go-version: 1.18
44+
45+
- name: Build
46+
run: go build -v ./...
47+
48+
- name: Test
49+
uses: robherley/go-test-action@v0.0.1
50+
```
51+

0 commit comments

Comments
 (0)