-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (68 loc) · 2.57 KB
/
Copy pathci.yml
File metadata and controls
79 lines (68 loc) · 2.57 KB
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
name: CI
run-name: "CI: ${{ github.ref_name }} [${{ github.event_name }}]"
on:
pull_request:
branches: [master]
push:
branches: [master]
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
jobs:
openapi-validate:
name: OpenAPI spec validation (openapi-generator-cli)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: temurin
java-version: '21'
- name: Validate OpenAPI specs
run: |
npx @openapitools/openapi-generator-cli@2.39.1 validate -i spec/openapi.yaml
npx @openapitools/openapi-generator-cli@2.39.1 validate -i spec/openapi_admin.yaml
npx @openapitools/openapi-generator-cli@2.39.1 validate -i spec/openapi_authorization_sync.yaml
npx @openapitools/openapi-generator-cli@2.39.1 validate -i spec/openapi_receiver.yaml
npx @openapitools/openapi-generator-cli@2.39.1 validate -i spec_webhook/openapi.yaml
openapi-lint:
name: OpenAPI lint (Redocly)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '20'
- name: Lint OpenAPI specs
run: |
npx @redocly/openapi-cli@1.0.0-beta.94 lint --config lint_config.yaml spec/openapi.yaml
npx @redocly/openapi-cli@1.0.0-beta.94 lint --config lint_config.yaml spec/openapi_admin.yaml
npx @redocly/openapi-cli@1.0.0-beta.94 lint --config lint_config.yaml spec/openapi_receiver.yaml
npx @redocly/openapi-cli@1.0.0-beta.94 lint --config lint_config.yaml spec/openapi_authorization_sync.yaml
npx @redocly/openapi-cli@1.0.0-beta.94 lint --config lint_config.yaml spec_webhook/openapi.yaml
ci-success:
if: ${{ always() }}
needs:
- openapi-validate
- openapi-lint
runs-on: ubuntu-latest
steps:
- name: Evaluate workflow results
env:
NEEDS_RESULT: ${{ join(needs.*.result, ',') }}
run: |
echo "$NEEDS_RESULT"
if [[ "$NEEDS_RESULT" =~ failure|cancelled ]]; then
exit 1
fi