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. 39
      .github/workflows/ci-cd.yml

39
.github/workflows/ci-cd.yml

@ -28,6 +28,33 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
jobs: 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: unit-tests:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
timeout-minutes: 40 timeout-minutes: 40
@ -45,7 +72,7 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
- name: remove use-node-version from .npmrc - name: remove use-node-version from .npmrc
run: sed -i '/^use-node-version/d' .npmrc run: sed -i '/^use-node-version/d' .npmrc
- name: Get pnpm store directory - name: Get pnpm store directory
shell: bash shell: bash
@ -80,8 +107,8 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
- name: remove use-node-version from .npmrc - name: remove use-node-version from .npmrc
run: sed -i '/^use-node-version/d' .npmrc run: sed -i '/^use-node-version/d' .npmrc
- name: Get pnpm store directory - name: Get pnpm store directory
shell: bash shell: bash
run: | run: |
@ -134,7 +161,7 @@ jobs:
uses: ./.github/workflows/playwright-test-workflow.yml uses: ./.github/workflows/playwright-test-workflow.yml
with: with:
db: mysql db: mysql
shard: 4 shard: 4
playwright-sqlite-1: playwright-sqlite-1:
needs: pre-build-for-playwright needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }} if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
@ -162,7 +189,7 @@ jobs:
uses: ./.github/workflows/playwright-test-workflow.yml uses: ./.github/workflows/playwright-test-workflow.yml
with: with:
db: sqlite db: sqlite
shard: 4 shard: 4
playwright-pg-shard-1: playwright-pg-shard-1:
needs: pre-build-for-playwright needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }} if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
@ -190,4 +217,4 @@ jobs:
uses: ./.github/workflows/playwright-test-workflow.yml uses: ./.github/workflows/playwright-test-workflow.yml
with: with:
db: pg db: pg
shard: 4 shard: 4

Loading…
Cancel
Save