This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
248 lines (236 loc) · 9.12 KB
/
verification.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
name: Verification Tests
on:
pull_request:
push:
branches:
- master
jobs:
lint:
name: Lint
uses: flyteorg/flytetools/.github/workflows/lint.yml@master
with:
go-version: 1.19
tests:
name: Unit Tests
uses: flyteorg/flytetools/.github/workflows/tests.yml@master
secrets:
FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }}
with:
go-version: 1.19
generate-protos:
runs-on: ubuntu-latest
name: Generate Protos
container:
image: lyft/protocgenerator:8167e11d3b3439373c2f033080a4b550078884a2
options: --cpus 1
volumes:
- /github/workspace:/defs
env:
REPO_BLOB_SHA: master
PROJECT_ANNOTATION_PREFIX: flyte.interface
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: "Clean Generated"
run: rm -rf ./gen
# GO Protos
- name: Proto-Service-Go
run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/service --with_gateway -l go --go_source_relative
- name: Proto-Admin-Go
run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/admin --with_gateway -l go --go_source_relative --validate_out
- name: Proto-Core-Go
run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/core --with_gateway -l go --go_source_relative --validate_out
- name: Proto-Event-Go
run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/event --with_gateway -l go --go_source_relative --validate_out
- name: Proto-Plugins-Go
run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/plugins -l go --go_source_relative --validate_out
- name: Proto-Datacatalog-Go
run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/datacatalog -l go --go_source_relative --validate_out
# Python is going to be generated using buf
# Python
# - name: Proto-Service-Python
# run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/service -l python
# - name: Proto-Admin-Python
# run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/admin -l python
# - name: Proto-Core-Python
# run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/core -l python
# - name: Proto-Event-Python
# run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/event -l python
# - name: Proto-Plugins-Python
# run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/plugins -l python
# - name: Proto-Datacatalog-Python
# run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/datacatalog -l python
# Cpp
- name: Proto-Service-Cpp
run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/service -l cpp
- name: Proto-Admin-Cpp
run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/admin -l cpp
- name: Proto-Core-Cpp
run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/core -l cpp
- name: Proto-Event-Cpp
run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/event -l cpp
- name: Proto-Plugins-Cpp
run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/plugins -l cpp
- name: Proto-Datacatalog-Cpp
run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/datacatalog -l cpp
# Java
- name: Proto-Service-Java
run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/service -l java
- name: Proto-Admin-Java
run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/admin -l java
- name: Proto-Core-Java
run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/core -l java
- name: Proto-Event-Java
run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/event -l java
- name: Proto-Plugins-Java
run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/plugins -l java
- name: Proto-Datacatalog-Java
run: python3 /usr/local/bin/entrypoint.py -i ./protos -d protos/flyteidl/datacatalog -l java
- uses: actions/upload-artifact@master
with:
name: generated
path: ./gen
generate-protos-buf:
name: Generate python protos using buf
runs-on: ubuntu-latest
needs: [ generate-protos ]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: "0"
- uses: bufbuild/buf-setup-action@v1
- name: "Clean Generated"
run: rm -rf ./gen
- name: "Run buf generate"
run: buf generate
- name: "Include __init__.py files"
run: find gen/pb_python -type d -exec touch {}/__init__.py \;
- uses: actions/upload-artifact@master
with:
name: generated-buf
path: ./gen
generate-admin-swagger-code:
runs-on: ubuntu-latest
name: Generate Admin Swagger Code
needs:
- generate-protos
- generate-protos-buf
container:
image: lyft/protocgenerator:8167e11d3b3439373c2f033080a4b550078884a2
options: --cpus 1
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: "Clean Generated"
run: rm -rf ./gen
- uses: actions/download-artifact@master
with:
name: generated
path: ./gen
- uses: actions/download-artifact@master
with:
name: generated-buf
path: ./gen
- run: ls gen/pb-go/flyteidl/service/
- run: cp -R gen/pb-go/flyteidl/service/ ../
- run: ls ../service/
# Open API 2
- name: OpenAPI-Binary
run: go-bindata -pkg service -o ../service/openapi.go -prefix ../service/ -modtime 1562572800 ../service/admin.swagger.json
- run: rm -rf gen/pb-go/flyteidl/service
- run: mkdir -p gen/pb-go/flyteidl/service
- run: cp -R ../service gen/pb-go/flyteidl/
- run: ls gen/pb-go/flyteidl/
- run: ls gen/pb-go/flyteidl/service/
- uses: actions/upload-artifact@master
with:
name: generated
path: ./gen
generate-js-code:
runs-on: ubuntu-latest
name: Generate JS Code
needs: [ generate-admin-swagger-code ]
container:
image: schottra/docker-protobufjs:v0.0.2
options: --cpus 1
volumes:
- /github/workspace:/defs
env:
REPO_BLOB_SHA: master
PROJECT_ANNOTATION_PREFIX: flyte.interface
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: "Clean Generated"
run: rm -rf ./gen
- uses: actions/download-artifact@master
with:
name: generated
path: ./gen
- run: mkdir -p /defs
- run: mkdir -p /gen
- run: cp -R . /defs
- run: node /code/generate-protobuf.js --module-name flyteidl -d protos/flyteidl/core -d protos/flyteidl/event -d protos/flyteidl/admin -d protos/flyteidl/service -- --root flyteidl -t static-module -w default --no-delimited --force-long --no-convert -p /defs/protos
- run: ls /defs/gen/
- uses: actions/upload-artifact@master
with:
name: generated
path: /defs/gen
generate-swagger-code:
runs-on: ubuntu-latest
name: Generate Swagger Code
needs: [ generate-js-code ]
container:
image: docker.io/lyft/swagger-codegen-cli:dc5ce6ec6d7d4d980fa882d6bd13a83cba3be3c3
options: --cpus 1
volumes:
- /github/workspace:/defs
env:
REPO_BLOB_SHA: master
PROJECT_ANNOTATION_PREFIX: flyte.interface
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: "Clean Generated"
run: rm -rf ./gen
- uses: actions/download-artifact@master
with:
name: generated
path: ./gen
- run: java -jar /opt/swagger-codegen-cli/swagger-codegen-cli.jar generate -i ./gen/pb-go/flyteidl/service/admin.swagger.json -l go -o ./gen/pb-go/flyteidl/service/flyteadmin --additional-properties=packageName=flyteadmin
- run: java -jar /opt/swagger-codegen-cli/swagger-codegen-cli.jar generate -i ./gen/pb-go/flyteidl/service/admin.swagger.json -l python -o ./gen/pb_python/flyteidl/service/flyteadmin --additional-properties=packageName=flyteadmin
- uses: actions/upload-artifact@master
with:
name: generated
path: ./gen
test-proto-changes:
runs-on: ubuntu-latest
name: Test Proto Changes
needs: [ generate-swagger-code ]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: "Clean Generated"
run: rm -rf ./gen
- uses: actions/download-artifact@master
with:
name: generated
path: ./gen
- name: Test
run: ./scripts/test_diff.sh
generate:
name: Check Generate
uses: flyteorg/flytetools/.github/workflows/go_generate.yml@master
with:
go-version: 1.19