-
Notifications
You must be signed in to change notification settings - Fork 26
49 lines (41 loc) · 1.25 KB
/
validate-openapi-on-pr.yaml
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 OpenAPI spec and Golang bindings
on:
push:
branches:
- main
pull_request:
jobs:
check-openapi-and-bindings:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- 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
working-directory: runner
run: |
python gen_openapi.py
- name: Check for OpenAPI spec changes
run: |
if ! git diff --exit-code; then
echo "::error:: OpenAPI spec has changed. Please run 'python gen_openapi.py' in the 'runner' directory and commit the changes."
exit 1
fi
- name: Generate Go bindings
run: make
- name: Check for Go bindings changes
run: |
if ! git diff --exit-code; then
echo "::error::Go bindings have changed. Please run 'make' at the root of the repository and commit the changes."
exit 1
fi