mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-06-02 01:22:11 +08:00
add swagger validator workflow
This commit is contained in:
parent
e8a92e4c9b
commit
d65ad9940b
49
.github/workflows/openapi-validation.yml
vendored
Normal file
49
.github/workflows/openapi-validation.yml
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
name: Validate OpenAPI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'openapi.yaml'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'openapi.yaml'
|
||||
|
||||
jobs:
|
||||
openapi-check:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Service containers to run with `runner-job`
|
||||
services:
|
||||
# Label used to access the service container
|
||||
swagger-editor:
|
||||
# Docker Hub image
|
||||
image: swaggerapi/swagger-editor
|
||||
ports:
|
||||
# Maps port 8080 on service container to the host 80
|
||||
- 80:8080
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Validate OpenAPI definition
|
||||
uses: swaggerexpert/swagger-editor-validate@v1
|
||||
with:
|
||||
definition-file: openapi.yaml
|
||||
swagger-editor-url: http://localhost/
|
||||
default-timeout: 20000
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Install test dependencies
|
||||
run: |
|
||||
pip install -r tests-api/requirements.txt
|
||||
|
||||
- name: Run OpenAPI spec validation tests
|
||||
run: |
|
||||
pytest tests-api/test_spec_validation.py -v
|
Loading…
x
Reference in New Issue
Block a user