Skip to content

Commit

Permalink
Merge pull request #4 from ckeshava/githubActions
Browse files Browse the repository at this point in the history
Sanity checks: Github Action workflow
  • Loading branch information
ckeshava authored Jul 24, 2024
2 parents 3cf2d39 + fec69a1 commit 7239de1
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/validate-openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Validate OpenAPI Spec

on:
push:
paths:
- '**/*.yaml'
- '**/*.json'
pull_request:
paths:
- '**/*.yaml'
- '**/*.json'

jobs:
validate-openapi:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'

- name: Install Redocly CLI
run: |
npm install # setup the dependencies from package.json
npm install -g @redocly/cli
echo "Redocly CLI successfully installed:"
redocly --version
- name: Validate OpenAPI Spec
run: |
redocly lint ./open_api/json_api.yaml
redocly lint ./open_api/json_api_v2.yaml
- name: Check Validation Result
if: failure()
run: echo "OpenAPI Specification validation failed"

validate-asyncapi:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'

- name: Install AsyncAPI CLI
run: |
npm install # setup the dependencies from package.json
npm i @asyncapi/cli
echo "AsyncAPI CLI successfully installed:"
asyncapi --version
- name: Validate AsyncAPI Spec
run: |
asyncapi validate ./async_api/websocket_api.yaml
asyncapi validate ./async_api/websocket_api_v2.yaml
- name: Check Validation Result
if: failure()
run: echo "AsyncAPI Specification validation failed"

0 comments on commit 7239de1

Please sign in to comment.