-
Notifications
You must be signed in to change notification settings - Fork 9
40 lines (35 loc) · 1.28 KB
/
Copy pathcheck-generated-code.yml
File metadata and controls
40 lines (35 loc) · 1.28 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
name: Check Generated Code
on:
workflow_dispatch:
jobs:
check-rust-code:
name: Check Generated Rust Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Setup Weaver
uses: open-telemetry/weaver/.github/actions/setup-weaver@3a3b7cc98e08f84bccda45c0f20522b51d64a88c # v0.23.0
- name: Generate Rust code
run: |
cd basic
weaver registry generate \
-r ./model \
--templates ./templates \
rust ./src
- name: Check for uncommitted changes
run: |
cd basic
if ! git diff --exit-code ./src/attributes.rs ./src/metrics.rs; then
echo "❌ Generated code is out of sync!"
echo ""
echo "The generated Rust code differs from committed files."
echo "Please regenerate locally and commit the changes:"
echo ""
echo " cd basic"
echo " weaver registry generate -r ./model --templates ./templates rust ./src"
echo " git add src/attributes.rs src/metrics.rs"
echo " git commit -m 'chore: regenerate Rust code'"
echo ""
exit 1
fi
echo "✅ Generated code is up to date"