File tree 3 files changed +24
-10
lines changed
3 files changed +24
-10
lines changed Original file line number Diff line number Diff line change @@ -104,9 +104,7 @@ jobs:
104
104
if : ${{ inputs.run-tests }}
105
105
working-directory : ./${{ inputs.project-directory }}
106
106
timeout-minutes : 30
107
- run : |
108
- go install gotest.tools/gotestsum@latest
109
- make test-unit
107
+ run : make test-unit
110
108
111
109
- name : Upload SonarCloud files
112
110
if : ${{ github.ref_name == 'main' && github.repository_owner == 'testcontainers' && inputs.run-tests && !inputs.rootless-docker }}
Original file line number Diff line number Diff line change 50
50
51
51
- name : go test
52
52
timeout-minutes : 30
53
- run : |
54
- go install gotest.tools/gotestsum@latest
55
- gotestsum --format short-verbose --rerun-fails=5 --packages="./..." --junitfile TEST-unit.xml -- -timeout=30m
53
+ run : make test-unit
56
54
57
55
- name : Create success status
58
56
uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
Original file line number Diff line number Diff line change 1
1
ROOT_DIR: =$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST ) ) ) )
2
+ GOBIN = $(GOPATH ) /bin
3
+
4
+ define go_install
5
+ go install $(1 )
6
+ endef
7
+
8
+ $(GOBIN ) /golangci-lint :
9
+ $(call go_install,github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2)
10
+
11
+ $(GOBIN ) /gotestsum :
12
+ $(call go_install,gotest.tools/gotestsum@latest)
13
+
14
+ .PHONY : install
15
+ install : $(GOBIN ) /golangci-lint $(GOBIN ) /gotestsum
16
+
17
+ .PHONY : clean
18
+ clean :
19
+ rm $(GOBIN ) /golangci-lint
20
+ rm $(GOBIN ) /gotestsum
2
21
3
22
.PHONY : dependencies-scan
4
23
dependencies-scan :
5
24
@echo " >> Scanning dependencies in $( CURDIR) ..."
6
25
go list -json -m all | docker run --rm -i sonatypecommunity/nancy:latest sleuth --skip-update-check
7
26
8
27
.PHONY : lint
9
- lint :
28
+ lint : $( GOBIN ) /golangci-lint
10
29
golangci-lint run --out-format=github-actions --path-prefix=. --verbose -c $(ROOT_DIR ) /.golangci.yml --fix
11
30
12
31
.PHONY : test-%
13
- test-% :
32
+ test-% : $( GOBIN ) /gotestsum
14
33
@echo " Running $* tests..."
15
34
gotestsum \
16
35
--format short-verbose \
26
45
go mod download
27
46
28
47
.PHONY : test-tools
29
- test-tools :
30
- go install gotest.tools/gotestsum@latest
48
+ test-tools : $(GOBIN ) /gotestsum
31
49
32
50
.PHONY : tools-tidy
33
51
tools-tidy :
You can’t perform that action at this time.
0 commit comments