Repo sync #34
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: Validate OpenAPI Check Docker | |
| # **What it does**: Tests building and running the OpenAPI check Docker container | |
| # **Why we have it**: To ensure the Dockerfile and openapi-check script work correctly | |
| # **Who does it impact**: Docs engineering. | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| paths: | |
| - 'Dockerfile.openapi_decorator' | |
| - 'src/rest/scripts/openapi-check.ts' | |
| - 'src/rest/scripts/utils/get-operations.ts' | |
| - 'src/rest/scripts/utils/operation.ts' | |
| # In case dependencies change | |
| - 'package.json' | |
| - 'package-lock.json' | |
| - 'tsconfig.json' | |
| # Self-test | |
| - '.github/workflows/validate-openapi-check.yml' | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate-openapi-check: | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'github/docs-internal' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 | |
| - name: Build Docker image | |
| run: | | |
| docker build -f Dockerfile.openapi_decorator -t openapi-decorator:test . | |
| - name: Test Docker image with sample OpenAPI file | |
| run: | | |
| docker run --rm openapi-decorator:test -f "src/rest/data/fpt-2022-11-28/schema.json" | |
| - name: Test Docker image with multiple OpenAPI files | |
| run: | | |
| docker run --rm openapi-decorator:test \ | |
| -f "src/rest/data/fpt-2022-11-28/schema.json" \ | |
| "src/rest/data/ghec-2022-11-28/schema.json" |