feat: add main dataset sharing on runner or scenario sharing #3639
Workflow file for this run
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: OpenAPI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '*' | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| branches: | |
| - 'main' | |
| - 'release/**' | |
| jobs: | |
| validate_projects_openapis: | |
| # The OpenAPI Generator Gradle Plugin exposes an 'openApiValidate' task, | |
| # but at this time, it does not work with Gradle 7.0. | |
| # See https://github.com/OpenAPITools/openapi-generator/issues/9328 | |
| # This job is a different approach for validation, using the Swagger Editor service, | |
| # as suggested here : https://swagger.io/blog/api-design/validate-openapi-definitions-swagger-editor/ | |
| runs-on: ubuntu-latest | |
| name: OpenAPI Validator Service | |
| services: | |
| swagger-editor: | |
| image: swaggerapi/swagger-editor:v3.16.5 | |
| ports: | |
| - 80:8080 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| project: | |
| - connector | |
| - dataset | |
| - organization | |
| - scenario | |
| - scenariorun | |
| - solution | |
| - workspace | |
| - twingraph | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Validate '${{ matrix.project }}' definition | |
| uses: swaggerexpert/[email protected] | |
| with: | |
| swagger-editor-url: http://localhost/ | |
| definition-file: ${{ matrix.project }}/src/main/openapi/${{ matrix.project }}.yaml | |
| merge_openapi_specs: | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # Fetch all tags since Gradle project version is built upon SCM | |
| fetch-depth: 0 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Merge OpenAPI definitions | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| uses: gradle/gradle-build-action@v3 | |
| with: | |
| cache-disabled: false | |
| # Cache storage space is limited for GitHub actions | |
| cache-read-only: ${{ github.ref != 'refs/heads/main' }} | |
| arguments: mergeOpenApiFiles | |
| - name: Archive openapi.yaml | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: openapi | |
| path: openapi/openapi.yaml | |
| retention-days: 3 | |
| validate_merged_openapi: | |
| # The OpenAPI Generator Gradle Plugin exposes an 'openApiValidate' task, | |
| # but at this time, it does not work with Gradle 7.0. | |
| # See https://github.com/OpenAPITools/openapi-generator/issues/9328 | |
| # This job is a different approach for validation, using the Swagger Editor service, | |
| # as suggested here : https://swagger.io/blog/api-design/validate-openapi-definitions-swagger-editor/ | |
| runs-on: ubuntu-latest | |
| needs: merge_openapi_specs | |
| services: | |
| swagger-editor: | |
| image: swaggerapi/swagger-editor:v3.18.2 | |
| ports: | |
| - 80:8080 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download openapi artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: openapi | |
| - name: Validate merged OpenAPI definition | |
| uses: swaggerexpert/[email protected] | |
| with: | |
| swagger-editor-url: http://localhost/ | |
| definition-file: openapi.yaml |