-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathaction.yml
More file actions
226 lines (199 loc) · 6.72 KB
/
Copy pathaction.yml
File metadata and controls
226 lines (199 loc) · 6.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
inputs:
context:
type: string
required: true
run-note:
type: string
default: |
**Note**
The above commands are specific to the CI environment and may need to be adjusted to run locally.
template:
type: string
default: |
## \($context.config.envoy.icon) \($context.check.name): \($context.target)
\($runSummary)
\($commandInfo)
### \($conclusion)
\($warning)
\($advice)
template-command:
type: string
default: |
#### Command
The following command was run:
\($runCommand)
\($containerInfo)
\($source)
\($stepsPre)
\($stepsPost)
\($runNote)
template-container-info:
type: string
default: |
#### Container command
The command was run inside a Docker container environment, which
was invoked by the following command
\($containerCommand)
\($entrypoint)
template-entrypoint:
type: string
default: |
The container used the following entrypoint
\($entrypointCode)
template-source:
type: string
default: |
The following code was sourced prior to execution
\($sourceCode)
template-steps-pre:
type: string
default: |
The following steps were run to prepare the CI environment:
\($stepsPreCode)
template-steps-post:
type: string
default: |
The following steps were run to cleanup or test the CI environment:
\($stepsPostCode)
template-title-advice:
type: string
default: >-
\($context.check.name) (\($context.target)) advice
template-title-failure:
type: string
default: >-
Command failed with exit code \($exitCode)
title-failure-cancelled:
type: string
default: >-
Run was cancelled
title-failure-post-steps:
type: string
default: >-
Upload failed
title-failure-upload:
type: string
default: >-
Upload failed
title-success:
type: string
default: >-
Command completed successfully
warning-catch-error:
type: string
default: >-
#### :warning: Error was caught
runs:
using: composite
steps:
- uses: envoyproxy/toolshed/actions/jq@718038ba06daddeee163f264a77aa47b31a66779
if: ${{ fromJSON(env.CI_DEBUG || 'false') && true || false }}
with:
input: ${{ inputs.context }}
print-result: true
- uses: envoyproxy/toolshed/actions/jq@718038ba06daddeee163f264a77aa47b31a66779
name: Runtime information
id: run-info
with:
input: ${{ inputs.context }}
print-result: true
filter: >-
{"runs-on": .context["runs-on"],
"exit-code": .run["exit-code"],
"upload-failed": (.run["upload-failed"] // false ),
"post-steps-failed": (.run["post-steps-failed"] // false ),
cancelled: .run.cancelled,
"job-started": .context["job-started"],
started: .run.started,
completed: .run.completed,
"run-time": "\(.run.completed - .run.started | . * 100 | round / 100)s",
"job-time": "\(.run.completed - .context["job-started"] | . * 100 | round / 100)s"}
- uses: envoyproxy/toolshed/actions/json/table@718038ba06daddeee163f264a77aa47b31a66779
name: Run information summary
id: run-summary
with:
json: ${{ steps.run-info.outputs.value }}
title: Runtime information
- uses: envoyproxy/toolshed/actions/jq@718038ba06daddeee163f264a77aa47b31a66779
with:
input: ${{ inputs.context }}
options: -r
output-path: GITHUB_STEP_SUMMARY
print-output: ${{ fromJSON(env.CI_DEBUG || 'false') && true || false }}
filter: |
.context as $context
| .run as $run
| .run["exit-code"] as $exitCode
| $context["catch-errors"] as $catchErrors
| .run["upload-failed"] as $uploadFailed
| {}
| if $run.cancelled then
.conclusion = ("${{ inputs.title-failure-cancelled }}" | gfm::action("failure"))
elif $exitCode != 0 then
.conclusion = ("${{ inputs.template-title-failure }}" | gfm::action("failure"))
elif $run["post-steps-failed"] then
.conclusion = ("${{ inputs.title-failure-post-steps }}" | gfm::action("failure"))
elif $uploadFailed then
.conclusion = ("${{ inputs.title-failure-upload }}" | gfm::action("failure"))
else
.conclusion = ("${{ inputs.title-success }}" | gfm::action("success"))
end
| .advice = ($context.check.advice[$context.target] // "")
| if .advice != "" then
.advice |= ({content: ., title: (. | "${{ inputs.template-title-advice }}")} | gfm::collapse)
else
.advice = ""
end
| if ($catchErrors and $exitCode) then
.warning = "${{ inputs.warning-catch-error }}"
else
.warning = ""
end
| .conclusion as $conclusion
| .warning as $warning
| .advice as $advice
| $run["steps-pre"]
| if (. | str::isempty | not) then
gfm::fence("yaml") as $stepsPreCode
| "${{ inputs.template-steps-pre }}"
| {title: "Pre-steps", content: ., indent: 0}
| gfm::collapse
else "" end
| . as $stepsPre
| $run["steps-post"]
| if (. | str::isempty | not) then
gfm::fence("yaml") as $stepsPostCode
| "${{ inputs.template-steps-post }}"
| {title: "Post-steps", content: ., indent: 0}
| gfm::collapse
else "" end
| . as $stepsPost
| $run.entrypoint
| if (. | str::isempty | not) then
gfm::fence("bash") as $entrypointCode
| "${{ inputs.template-entrypoint }}"
| {title: "Container entrypoint", content: ., indent: 0}
| gfm::collapse
else "" end
| . as $entrypoint
| $run.source
| if (. | str::isempty | not) then
gfm::fence("bash") as $sourceCode
| "${{ inputs.template-source }}"
| {title: "Source", content: ., indent: 0}
| gfm::collapse
else "" end
| . as $source
| if ($run["container-command"] | str::isempty | not) then
"$ \($run["container-command"])"
| gfm::fence("console") as $containerCommand
| "${{ inputs.template-container-info }}"
else "" end
| . as $containerInfo
| ("${{ inputs.run-note }}" | gfm::blockquote) as $runNote
| (("$ " + $run.command) | gfm::fence("console")) as $runCommand
| "${{ inputs.template-command }}"
| {title: "CI command", content: .}
| gfm::collapse as $commandInfo
| "${{ steps.run-summary.outputs.summary }}" as $runSummary
| "${{ inputs.template }}"