@@ -167,12 +167,52 @@ jobs:
167167 exit 1
168168 fi
169169
170+ openapi-spec :
171+ name : " Verify OpenAPI spec is up to date"
172+ runs-on : ubuntu-latest
173+ needs : changes
174+ if : needs.changes.outputs.agentex == 'true'
175+ timeout-minutes : 10
176+
177+ steps :
178+ - name : Checkout
179+ uses : actions/checkout@v4
180+
181+ - name : Set up Python
182+ uses : actions/setup-python@v5
183+ with :
184+ python-version : ' 3.12'
185+
186+ - name : Install uv
187+ uses : astral-sh/setup-uv@v4
188+ with :
189+ version : " 0.7.3"
190+ enable-cache : true
191+
192+ - name : Install dependencies
193+ working-directory : ./agentex
194+ run : uv sync
195+
196+ - name : Regenerate OpenAPI spec
197+ working-directory : ./agentex
198+ run : uv run python scripts/generate_openapi_spec.py --output openapi.yaml
199+
200+ - name : Verify committed spec matches generated spec
201+ working-directory : ./agentex
202+ run : |
203+ if ! git diff --exit-code openapi.yaml; then
204+ echo "❌ The committed openapi.yaml is out of date."
205+ echo "Run 'uv run python scripts/generate_openapi_spec.py --output openapi.yaml' from agentex/ and commit the result."
206+ exit 1
207+ fi
208+ echo "✅ openapi.yaml is up to date"
209+
170210 # This job is used as a required status check for branch protection
171211 # It will pass if the conditional jobs either passed or were skipped
172212 ci-status :
173213 name : " CI Status Check"
174214 runs-on : ubuntu-latest
175- needs : [changes, test, docs]
215+ needs : [changes, test, docs, openapi-spec ]
176216 if : always()
177217 steps :
178218 - name : Check CI status
@@ -191,7 +231,12 @@ jobs:
191231 echo "❌ Documentation build failed"
192232 exit 1
193233 fi
194-
234+
235+ if [ "${{ needs.openapi-spec.result }}" != "success" ]; then
236+ echo "❌ OpenAPI spec freshness check failed"
237+ exit 1
238+ fi
239+
195240 echo "✅ All checks passed"
196241 else
197242 echo "No agentex changes detected - skipping tests and docs"
0 commit comments