-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (55 loc) · 2.17 KB
/
check-codegen.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
# This workflow will delete and regenerate the opentelemetry marshaling code using scripts/proto_codegen.sh.
# If generating the code produces any changes from what is currently checked in, the workflow will fail and prompt the user to regenerate the code.
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Check Codegen
on:
push:
branches: [ "main" ]
paths:
- "scripts/**"
- "src/snowflake/telemetry/_internal/opentelemetry/proto/**"
- "src/snowflake/telemetry/_internal/proto_impl/**"
- "src/snowflake/telemetry/serialize/**"
- ".github/workflows/check-codegen.yml"
pull_request:
branches: [ "main" ]
paths:
- "scripts/**"
- "src/snowflake/telemetry/_internal/opentelemetry/proto/**"
- "src/snowflake/telemetry/_internal/proto_impl/**"
- "src/snowflake/telemetry/serialize/**"
- ".github/workflows/check-codegen.yml"
jobs:
check-codegen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Run py codegen script
run: |
rm -rf src/snowflake/telemetry/_internal/opentelemetry/proto/
rm -rf src/snowflake/telemetry/_internal/proto_impl/py/
./scripts/proto_codegen.sh
- name: Check for changes
run: |
git diff --exit-code || { echo "Code generation produced changes! Regenerate the code using ./scripts/proto_codegen.sh"; exit 1; }
check-codegen-pb:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Run pb codegen script
run: |
rm -rf src/snowflake/telemetry/_internal/proto_impl/v3/
rm -rf src/snowflake/telemetry/_internal/proto_impl/v5/
./scripts/proto_codegen_vX.sh 3
./scripts/proto_codegen_vX.sh 5
- name: Check for changes
run: |
git diff --exit-code || { echo "Code generation produced changes! Regenerate the code using ./scripts/proto_codegen_vX.sh <version>"; exit 1; }