Skip to content

Commit 7058d0f

Browse files
committed
additional flags input, output name correction
1 parent 7c2e773 commit 7058d0f

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,8 @@ steps:
4040
4141
## Notes
4242
43-
Lists tests by executing `go test ./... -list .` in the `GITHUB_WORKSPACE` (checkout) directory. Use the `packages` input to customize the packages string, and the `list` input to customize the list pattern. (See action.yml for details)
43+
Lists tests by executing `go test ./... -list .` in the `GITHUB_WORKSPACE` (checkout) directory.
44+
45+
Use the `packages` input to customize the packages string, and the `list` input to customize the list pattern. Pass additional test flags using `flags` (See action.yml for details)
46+
47+

action.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
name: 'Go Test Split'
22
author: 'Brandon Croft'
33
description: >
4-
Splits go tests as an output that can be passed as the run argument to `go test` in a matrix
4+
Given some splitting parameters (total slices and slice index), lists a subset of tests
5+
suitable for passing into go test -run.
56
runs:
67
using: 'node16'
78
main: 'dist/index.js'
@@ -18,8 +19,11 @@ inputs:
1819
description: "The packages string to use when executing `go test <packages> -list .` to find tests. Defaults to './...' (all packages recursively)"
1920
required: false
2021
list:
21-
description: "The list pattern to use when executing `go test <packages> -list <list>` to find tests. Defaults to '.' (all tests)"
22+
description: "The list pattern to use when executing `go test <packages> -list <list>`. Defaults to '.' (all tests)"
23+
required: false
24+
flags:
25+
description: "Additional flags to pass to `go test <packages> -list ."
2226
required: false
2327
outputs:
24-
tests-slice:
28+
run:
2529
description: "A slice of tests, suitable to pass into the -run argument of go test"

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "test-split-go",
3-
"version": "0.1.0",
3+
"version": "1.0.0",
44
"private": "true",
5-
"description": "Splits go tests as an output that can be passed as the run argument to `go test` in a matrix",
5+
"description": "Github action that lists a subset of tests suitable for passing into go test -run",
66
"main": "dist/index.js",
77
"scripts": {
88
"build": "ncc build src/action.ts -o dist --license licenses.txt",

src/go-test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class TestLister {
5858
core.getInput("packages") || "./...",
5959
"-list",
6060
core.getInput("list") || ".",
61+
core.getInput("flags"),
6162
];
6263

6364
core.debug(

0 commit comments

Comments
 (0)