forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
269 lines (260 loc) · 8.41 KB
/
_run.yml
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
name: Envoy CI
permissions:
contents: read
on:
workflow_call:
secrets:
app-id:
app-key:
rbe-key:
ssh-key:
ssh-key-extra:
inputs:
args:
type: string
bazel-extra:
type: string
bazel-rbe-jobs:
type: number
default: 75
cache-build-image:
type: string
catch-errors:
type: boolean
default: false
checkout-extra:
type: string
container-command:
type: string
default: ./ci/run_envoy_docker.sh
container-output:
type: string
default:
command:
type: string
default: ./ci/do_ci.sh
diskspace-hack:
type: boolean
default: false
diskspace-hack-paths:
type: string
default:
downloads:
type: string
entrypoint:
type: string
default:
error-match:
type: string
default: |
ERROR
error:
Error:
fail-match:
type: string
notice-match:
type: string
default: |
NOTICE
Streaming build results
output-path:
type: string
default:
rbe:
type: boolean
default: true
repo-fetch-depth:
type: number
default: 1
report-pre:
type: string
default: |
- run: |
echo "disk space at beginning of build:"
df -h
shell: bash
report-post:
type: string
default: |
- run: |
echo "disk space at end of build:"
df -h
shell: bash
request:
type: string
required: true
runs-on:
type: string
default:
skip:
type: boolean
default: false
source:
type: string
summary-post:
type: string
default: |
- uses: envoyproxy/toolshed/gh-actions/envoy/run/[email protected]
with:
context: %{{ inputs.context }}
steps-pre:
type: string
steps-pre-name:
type: string
steps-post:
type: string
default: |
- run: |
du -ch "%{{ inputs.temp-dir || runner.temp }}" | grep -E "[0-9]{2,}M|[0-9]G" || :
shell: bash
steps-post-name:
type: string
target:
type: string
required: true
temp-dir:
type: string
timeout-minutes:
type: number
default: 60
trusted:
type: boolean
required: true
upload-name:
type: string
upload-path:
type: string
warning-match:
type: string
default: |
WARNING
warning:
Warning:
working-directory:
type: string
default: .
concurrency:
group: >-
${{ github.actor != 'trigger-release-envoy[bot]'
&& github.head_ref
|| github.run_id
}}-${{ github.workflow }}-${{ inputs.target }}
cancel-in-progress: true
env:
CI_DEBUG: ${{ vars.CI_DEBUG }}
jobs:
ci:
permissions:
contents: read
packages: read
if: ${{ ! inputs.skip }}
runs-on: ${{ inputs.runs-on || fromJSON(inputs.request).config.ci.agent-ubuntu }}
name: ${{ inputs.command }} ${{ inputs.target }}
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- uses: envoyproxy/toolshed/gh-actions/[email protected]
id: started
name: Create timestamp
with:
options: -r
filter: |
now
# This controls which input vars are exposed to the run action (and related steps)
- uses: envoyproxy/toolshed/gh-actions/[email protected]
name: Context
id: context
with:
print-result: ${{ fromJSON(env.CI_DEBUG || 'false') && true || false }}
input: ${{ inputs.request }}
filter: |
.
| (.check // {name: "${{ github.workflow }}"}) as $check
| .config as $config
| if "${{ inputs.runs-on }}" != "" then
"${{ inputs.runs-on }}"
else .config.ci["agent-ubuntu"] end
| . as $runsOn
| {"target": "${{ inputs.target }}",
"catch-errors": ${{ inputs.catch-errors }},
"runs-on": $runsOn,
"job-started": ${{ steps.started.outputs.value }}}
| . * {$config, $check}
- if: ${{ inputs.cache-build-image }}
name: Restore Docker cache ${{ inputs.cache-build-image && format('({0})', inputs.cache-build-image) || '' }}
uses: envoyproxy/toolshed/gh-actions/docker/cache/[email protected]
with:
image_tag: ${{ inputs.cache-build-image }}
- uses: envoyproxy/toolshed/gh-actions/[email protected]
id: appauth
name: Appauth
if: ${{ inputs.trusted }}
with:
app_id: ${{ secrets.app-id }}
key: ${{ secrets.app-key }}
# You cant use a secret as a condition so this always runs even if the app id/key are empty
# - the workaround is to allow the token to be passed through.
token: ${{ github.token }}
token-ok: true
- uses: envoyproxy/toolshed/gh-actions/github/[email protected]
id: checkout
name: Checkout Envoy repository
with:
branch: ${{ fromJSON(inputs.request).request.target-branch }}
config: |
fetch-depth: ${{ inputs.repo-fetch-depth }}
# WARNING: This allows untrusted code to run!!!
# If this is set to run untrusted code, then anything before or after in the job should be regarded as
# compromisable.
ref: ${{ inputs.trusted && fromJSON(inputs.request).request.sha || fromJSON(inputs.request).request.ref }}
fetch-merge-commit: false
pr: ${{ fromJSON(inputs.request).request.pr }}
ssh-key: ${{ inputs.trusted && inputs.ssh-key || '' }}
token: ${{ inputs.trusted && steps.appauth.outputs.token || github.token }}
# This is currently only use by mobile-docs and can be removed once they are updated to the newer website
- uses: envoyproxy/toolshed/gh-actions/github/[email protected]
id: checkout-extra
name: Checkout extra repository (for publishing)
if: ${{ inputs.checkout-extra }}
with:
config: ${{ inputs.checkout-extra }}
ssh-key: ${{ inputs.trusted && inputs.ssh-key-extra || '' }}
- uses: envoyproxy/toolshed/gh-actions/github/[email protected]
name: Run CI ${{ inputs.command }} ${{ inputs.target }}
with:
args: ${{ inputs.args != '--' && inputs.args || inputs.target }}
catch-errors: ${{ inputs.catch-errors }}
command: ${{ inputs.command }}
container-command: ${{ env.CONTAINER_COMMAND || inputs.container-command }}
container-output: ${{ inputs.container-output }}
context: ${{ steps.context.outputs.value }}
diskspace-hack: ${{ inputs.diskspace-hack }}
diskspace-hack-paths: ${{ inputs.diskspace-hack-paths }}
downloads: ${{ inputs.downloads }}
entrypoint: ${{ inputs.entrypoint }}
error-match: ${{ inputs.error-match }}
fail-match: ${{ inputs.fail-match }}
notice-match: ${{ inputs.notice-match }}
output-path: ${{ inputs.output-path }}
report-pre: ${{ inputs.report-pre }}
report-post: ${{ inputs.report-post }}
source: ${{ inputs.source }}
steps-pre: ${{ inputs.steps-pre }}
steps-pre-name: ${{ inputs.steps-pre-name }}
steps-post: ${{ inputs.steps-post }}
steps-post-name: ${{ inputs.steps-post-name }}
summary-post: ${{ inputs.summary-post }}
upload-name: ${{ inputs.upload-name }}
upload-path: ${{ inputs.upload-path }}
warning-match: ${{ inputs.warning-match }}
working-directory: ${{ inputs.working-directory }}
env:
GITHUB_TOKEN: ${{ inputs.trusted && steps.appauth.outputs.token || github.token }}
ENVOY_DOCKER_BUILD_DIR: ${{ runner.temp }}
ENVOY_RBE: ${{ inputs.rbe != 'false' && 1 || '' }}
RBE_KEY: ${{ secrets.rbe-key }}
BAZEL_BUILD_EXTRA_OPTIONS: >-
--config=remote-ci
${{ inputs.bazel-extra }}
${{ inputs.rbe != 'false' && format('--jobs={0}', inputs.bazel-rbe-jobs) || '' }}
BAZEL_FAKE_SCM_REVISION: ${{ github.event_name == 'pull_request' && 'e3b4a6e9570da15ac1caffdded17a8bebdc7dfc9' || '' }}
CI_TARGET_BRANCH: ${{ fromJSON(inputs.request).request.target-branch }}