Skip to content

Commit a150a9b

Browse files
add a README
1 parent 1cf6d20 commit a150a9b

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# GitHub Action: multiple-go-modules
2+
3+
Go allows a Git repository to contain multiple Go modules (i.e. multiple directory trees that have their own `go.mod` file).
4+
When running Go tools like `go test ./...` or `go vet ./...` from the parent directory, it will only recurse into directories belonging to the same Go module.
5+
In order to run the command in all subdirectories, no matter which module they belong to, the command has to be invoked separately for every Go module.
6+
7+
This GitHub Action makes it easy to do this.
8+
9+
## Usage
10+
11+
Take the following example, running a command (or multiple commands) directly:
12+
13+
```yml
14+
steps:
15+
- name: Code Quality Checks
16+
run: |
17+
go vet ./...
18+
gofmt .
19+
```
20+
21+
Using this action, this would run the same command(s) in all Go modules:
22+
23+
```yml
24+
steps:
25+
- name: Code Quality Checks
26+
uses: protocol/multiple-go-modules@master
27+
with:
28+
run: |
29+
go vet ./...
30+
gofmt .
31+
```

0 commit comments

Comments
 (0)