-
Notifications
You must be signed in to change notification settings - Fork 29
56 lines (56 loc) · 1.7 KB
/
ci.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
name: Lint and validate OpenAPI specs
on:
- pull_request
jobs:
lint:
name: Lint OpenAPI definition
runs-on: ubuntu-latest
steps:
- name: Check out head branch
uses: actions/checkout@v4
- name: Run OpenAPI Lint Action
uses: mhiew/redoc-lint-github-action@v4
with:
args: 'openapi/task_execution_service.openapi.yaml'
validate:
name: Validate OpenAPI definition
runs-on: ubuntu-latest
steps:
- name: Check out head branch
uses: actions/checkout@v4
- name: Run OpenAPI Validate Action
uses: char0n/swagger-editor-validate@v1
with:
definition-file: openapi/task_execution_service.openapi.yaml
diff:
name: Show OpenAPI differences relative to target branch
runs-on: ubuntu-latest
outputs:
diff_generated: ${{ steps.upload-log.outputs.artifact_name }}
steps:
- name: Check out head branch
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
path: head
- name: Check out base branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
path: base
- name: Run OpenAPI Diff
run: |
docker run --rm \
-v $(pwd)/head:/head:ro \
-v $(pwd)/base:/base:ro \
-v $(pwd):/local \
openapitools/openapi-diff:2.0.1 \
/head/openapi/task_execution_service.openapi.yaml \
/base/openapi/task_execution_service.openapi.yaml \
--markdown /local/diff.md
- name: Upload log
id: upload-log
uses: actions/upload-artifact@v4
with:
name: openapi-diff-log
path: diff.md