-
Notifications
You must be signed in to change notification settings - Fork 1.2k
60 lines (58 loc) · 1.8 KB
/
Copy pathcompile-protos-check.yml
File metadata and controls
60 lines (58 loc) · 1.8 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
name: compile-protos-check
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- master
- 'releases/**'
pull_request:
branches:
- master
- 'releases/**'
merge_group:
jobs:
compile-protos-check:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Install the latest version of uv
uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4.2.0
with:
version: "latest"
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
uv venv --seed ~/test-env
source ~/test-env/bin/activate
uv pip install grpcio-tools==1.63.0
uv pip install grpcio==1.63.0
uv pip install protobuf==5.29.6
- name: Compile .proto files
run: |
source ~/test-env/bin/activate
python -m grpc_tools.protoc \
--proto_path=sky/schemas/generated=sky/schemas/proto \
--python_out=. \
--grpc_python_out=. \
--pyi_out=. \
sky/schemas/proto/*.proto
- name: Check for diff
run: |
if ! git diff --quiet sky/schemas/generated/; then
echo "Protobuf generated files are out of date."
echo "Please regenerate them by running:"
echo "python -m grpc_tools.protoc \\"
echo " --proto_path=sky/schemas/generated=sky/schemas/proto \\"
echo " --python_out=. \\"
echo " --grpc_python_out=. \\"
echo " --pyi_out=. \\"
echo " sky/schemas/proto/*.proto"
echo ""
echo "Differences found:"
git diff sky/schemas/generated/
exit 1
fi