forked from getsentry/sentry
59 lines (51 loc) · 1.91 KB
/
openapi-diff.yml
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
name: openapi-diff
on:
pull_request:
jobs:
check-diff:
name: build api
runs-on: ubuntu-18.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 }}
pip-cache-version: ${{ secrets.PIP_CACHE_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
- name: Install/setup node
if: steps.changes.outputs.api_docs == 'true'
uses: volta-cli/action@v1
- 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