-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (55 loc) · 1.73 KB
/
validate-openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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, version info:"
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 install -g @asyncapi/cli
echo "AsyncAPI CLI successfully installed, version info:"
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"