name: openapi-diff on: pull_request: jobs: check-diff: name: build api runs-on: ubuntu-20.04 timeout-minutes: 90 strategy: matrix: python-version: [3.8.12] steps: - uses: actions/checkout@v2 with: # Avoid codecov error message related to SHA resolution: # https://github.com/codecov/codecov-bash/blob/7100762afbc822b91806a6574658129fe0d23a7d/codecov#L891 fetch-depth: '2' - name: Check for python file changes uses: getsentry/paths-filter@v2 id: changes with: token: ${{ github.token }} filters: .github/file-filters.yml - name: Setup sentry env (python ${{ matrix.python-version }}) uses: ./.github/actions/setup-sentry if: steps.changes.outputs.api_docs == 'true' id: setup with: python-version: ${{ matrix.python-version }} - name: Checkout getsentry/sentry-api-schema uses: actions/checkout@v2 if: steps.changes.outputs.api_docs == 'true' with: ref: 'main' repository: getsentry/sentry-api-schema path: sentry-api-schema - uses: ./.github/actions/setup-volta if: steps.changes.outputs.api_docs == 'true' - name: Build OpenAPI Derefed JSON if: steps.changes.outputs.api_docs == 'true' # install ts-node for ts build scripts to execute properly without potentially installing # conflicting deps when running scripts locally # see: https://github.com/getsentry/sentry/pull/32328/files run: | yarn add ts-node && make build-api-docs - name: Compare OpenAPI Derefed JSON if: steps.changes.outputs.api_docs == 'true' run: | npx json-diff@0.5.4 --color sentry-api-schema/openapi-derefed.json tests/apidocs/openapi-derefed.json