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: internal/pkg/plugin/githubactions/golang/templates.go
+19-7Lines changed: 19 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,8 @@ jobs:
10
10
runs-on: ubuntu-latest
11
11
steps:
12
12
- name: Build
13
-
run: [[.Build.Command]]
13
+
run: [[- if not .Build.Command]] go build ./...[[- else]][[.Build.Command]][[- end]]
14
+
[[- else]]
14
15
[[- end]]
15
16
[[- if .Test.Enable]]
16
17
test:
@@ -22,15 +23,16 @@ jobs:
22
23
with:
23
24
go-version: 1.17
24
25
- name: Test
25
-
run: [[.Test.Command]] [[- if .Test.Coverage.Enable]] -race -covermode=atomic -coverprofile=[[.Test.Coverage.Output]] [[- end]]
26
+
run: [[- if not .Test.Command]] go test ./...[[- else]][[.Test.Command]][[- end]] [[- if .Test.Coverage.Enable]] -race -covermode=atomic -coverprofile=[[- if not .Test.Coverage.Output]]coverage.out[[- else]][[.Test.Coverage.Output]][[- end]] [[- end]]
26
27
[[- if .Test.Coverage.Enable]]
27
28
- name: comment PR
28
29
uses: machine-learning-apps/pr-comment@master
29
30
env:
30
31
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31
32
with:
32
-
path: [[.Test.Coverage.Output]]
33
+
path: [[- if not .Test.Coverage.Output]]coverage.out[[- else]][[.Test.Coverage.Output]][[- end]]
tags: ${{ secrets.DOCKERHUB_USERNAME }}/[[- if not .Docker.Repo]][[.Repo]][[- else]][[.Docker.Repo]][[- end]]:${{needs.tag.outputs.new_tag}}
69
71
[[- end]]
70
72
`
71
73
@@ -79,7 +81,8 @@ jobs:
79
81
runs-on: ubuntu-latest
80
82
steps:
81
83
- name: Build
82
-
run: [[.Build.Command]]
84
+
run: [[- if not .Build.Command]] go build ./...[[- else]][[.Build.Command]][[- end]]
85
+
[[- else]]
83
86
[[- end]]
84
87
[[- if .Test.Enable]]
85
88
test:
@@ -91,7 +94,16 @@ jobs:
91
94
with:
92
95
go-version: 1.17
93
96
- name: Test
94
-
run: [[.Test.Command]] [[- if .Test.Coverage.Enable]] -race -covermode=atomic -coverprofile=[[.Test.Coverage.Output]] [[- end]]
97
+
run: [[- if not .Test.Command]] go test ./...[[- else]][[.Test.Command]][[- end]] [[- if .Test.Coverage.Enable]] -race -covermode=atomic -coverprofile=[[- if not .Test.Coverage.Output]]coverage.out[[- else]][[.Test.Coverage.Output]][[- end]] [[- end]]
98
+
[[- if .Test.Coverage.Enable]]
99
+
- name: comment PR
100
+
uses: machine-learning-apps/pr-comment@master
101
+
env:
102
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103
+
with:
104
+
path: [[- if not .Test.Coverage.Output]]coverage.out[[- else]][[.Test.Coverage.Output]][[- end]]
0 commit comments