Skip to content

Commit

Permalink
ci: add PR OpenAPI/bindings check action
Browse files Browse the repository at this point in the history
This commit adds a simple action that notifies developers when they
forgot to update the OpenAPI spec or golang bindings.
  • Loading branch information
rickstaa committed Jul 23, 2024
1 parent 50c8009 commit 3a64bc5
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/validate-openapi-on-pr.yaml
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

0 comments on commit 3a64bc5

Please sign in to comment.