-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add codegen check CI job #5681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
emilykl
wants to merge
3
commits into
v7.0
Choose a base branch
from
add-ci-codegen-check
base: v7.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+67
−4
Open
Add codegen check CI job #5681
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| name: Check Python codegen | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| types: [opened, reopened, synchronize] | ||
|
|
||
| jobs: | ||
| check-python-codegen: | ||
| name: Check Python codegen | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | ||
| with: | ||
| python-version: "3.x" | ||
|
|
||
| - name: Set up uv | ||
| uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| uv venv | ||
| source .venv/bin/activate | ||
| uv lock --check | ||
| uv sync --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." | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.