-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
49 lines (44 loc) · 1.46 KB
/
Copy pathcheck-codegen.yml
File metadata and controls
49 lines (44 loc) · 1.46 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
name: Check Python codegen
on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
permissions:
contents: read
jobs:
check-python-codegen:
name: Check Python codegen
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.x"
- name: Set up uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
- name: Install dependencies
run: |
uv venv
source .venv/bin/activate
uv lock --check
uv sync --locked --extra dev_codegen
- name: Run codegen
run: |
source .venv/bin/activate
python commands.py codegen
- name: Check for changes
run: |
# Fail if codegen produced any changes to the working directory.
# This means the committed generated files are out of date and codegen
# needs to be re-run locally and the results committed.
if [ -n "$(git status --porcelain)" ]; then
echo "::error::Generated files are out of date. Please run 'python commands.py codegen' locally and commit the result."
echo "The following files differ after running codegen:"
git status --porcelain
echo ""
exit 1
fi
echo "Generated files are up to date."