-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from ckeshava/githubActions
Sanity checks: Github Action workflow
- Loading branch information
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|