CI: 11/merge [pull_request] #6
This file contains hidden or 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
| 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 |