-
-
Notifications
You must be signed in to change notification settings - Fork 13
85 lines (72 loc) · 2.33 KB
/
main.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Swagger Editor Validate CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test_github_action:
runs-on: ubuntu-latest
name: Swagger Editor Validate - Repo integrity
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '20'
- run: npm ci
- run: npm run lint
test_swagger_editor_validate_service:
runs-on: ubuntu-latest
name: Swagger Editor Validate Service
# Service containers to run with `runner-job`
services:
# Label used to access the service container
swagger-editor:
# Docker Hub image
image: swaggerapi/swagger-editor
ports:
# Maps port 8080 on service container to the host 80
- 80:8080
steps:
- uses: actions/checkout@v2
- name: Validate OpenAPI definition
uses: swaggerexpert/swagger-editor-validate@master
with:
swagger-editor-url: http://localhost/
definition-file: examples/openapi-2-0.yaml
test_swagger_editor_validate_remote:
runs-on: ubuntu-latest
name: Swagger Editor Validate Remote
steps:
- uses: actions/checkout@v2
- name: Validate OpenAPI definition
uses: swaggerexpert/swagger-editor-validate@master
with:
definition-file: examples/openapi-2-0.yaml
test_swagger_editor_error:
runs-on: ubuntu-latest
name: Swagger Editor Validate
steps:
- uses: actions/checkout@v2
- name: Validate OpenAPI definition
continue-on-error: true
id: validate
uses: swaggerexpert/swagger-editor-validate@master
with:
definition-file: examples/openapi-2-0-error.yaml
- name: Check for failure
if: steps.validate.outcome != 'failure'
run: exit 1
- name: Check for error message
if: ${{ !contains('Definition contains errors', steps.validate.outputs.stdout.contains) }}
run: exit 1
test_swagger_editor_ignore_error:
runs-on: ubuntu-latest
name: Swagger Editor Ignore Errors
steps:
- uses: actions/checkout@v2
- name: Validate OpenAPI definition
uses: swaggerexpert/swagger-editor-validate@master
with:
definition-file: examples/openapi-2-0-error.yaml
ignore-error: examples/ignore-error.js