Browse Source

chore: action to validate swagger json

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/7799/head
Pranav C 7 months ago
parent
commit
cd0753c6c6
  1. 27
      .github/workflows/ci-cd.yml

27
.github/workflows/ci-cd.yml

@ -28,6 +28,33 @@ concurrency:
cancel-in-progress: true
jobs:
validate-swagger-json:
runs-on: ubuntu-20.04
timeout-minutes: 10
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
# enable after fixing all validation errors
# - name: Validate OpenAPI definition
# uses: char0n/swagger-editor-validate@v1
# with:
# swagger-editor-url: http://localhost/
# definition-file: packages/nocodb/src/schema/swagger.json
- name: Validate Swagger JSON
run: |
if ! jq empty packages/nocodb/src/schema/swagger.json; then
echo "swagger.json file is not valid JSON"
exit 1
fi
if ! jq empty packages/nocodb/src/schema/swagger-v2.json; then
echo "swaggerv2.json file is not valid JSON"
exit 1
fi
unit-tests:
runs-on: ubuntu-20.04
timeout-minutes: 40

Loading…
Cancel
Save