-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add PR OpenAPI/bindings check action
This commit adds a simple action that notifies developers when they forgot to update the OpenAPI spec or golang bindings.
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,48 @@ | ||
name: Check OpenAPI spec & Golang bindings update | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
check-openapi-spec: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
cache: "pip" | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r runner/requirements.txt | ||
- name: Generate AI OpenAPI specification | ||
run: | | ||
cd runner | ||
python gen_openapi.py | ||
cd $GITHUB_WORKSPACE | ||
- name: Check OpenAPI change | ||
run: | | ||
git diff --exit-code | ||
if [ $? -ne 0 ]; then | ||
echo "OpenAPI spec has changed. Please run 'python gen_openapi.py' and commit the changes." | ||
exit 1 | ||
fi | ||
- name: Generate Go bindings | ||
run: | | ||
make | ||
- name: Check Go bindings change | ||
run: | | ||
git diff --exit-code | ||
if [ $? -ne 0 ]; then | ||
echo "Go bindings have changed. Please run 'make' and commit the changes." | ||
exit 1 | ||
fi |