|
65 | 65 | ref: ${{ github.event.pull_request.base.ref }} |
66 | 66 | path: 'base' |
67 | 67 |
|
| 68 | + |
| 69 | + # Cache openai spec |
| 70 | + - name: Cache openai openapi spec |
| 71 | + id: cache-openapi |
| 72 | + uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 |
| 73 | + with: |
| 74 | + path: ~/openai-openapi |
| 75 | + key: openai-openapi.yml |
| 76 | + |
68 | 77 | # Cache oasdiff to avoid checksum failures and speed up builds |
69 | 78 | - name: Cache oasdiff |
70 | 79 | if: steps.skip-check.outputs.skip != 'true' |
|
81 | 90 | curl -fsSL https://raw.githubusercontent.com/oasdiff/oasdiff/main/install.sh | sh |
82 | 91 | cp /usr/local/bin/oasdiff ~/oasdiff |
83 | 92 |
|
| 93 | + - name: Get openai openapi spec |
| 94 | + if: steps.cache-openapi.outputs.cache-hit != 'true' |
| 95 | + run: | |
| 96 | + mkdir -p ~/openai-openapi |
| 97 | + curl -L https://app.stainless.com/api/spec/documented/openai/openapi.documented.yml -o ~/openai-openapi/openai-openapi.yml |
| 98 | +
|
84 | 99 | # Setup cached oasdiff |
85 | 100 | - name: Setup cached oasdiff |
86 | 101 | if: steps.skip-check.outputs.skip != 'true' && steps.cache-oasdiff.outputs.cache-hit == 'true' |
@@ -137,6 +152,20 @@ jobs: |
137 | 152 | run: | |
138 | 153 | oasdiff breaking --fail-on ERR $BASE_SPEC $CURRENT_SPEC --match-path '^/v1/' |
139 | 154 |
|
| 155 | + # Run oasdiff to detect breaking changes in the API specification when compared to the OpenAI openAPI spec |
| 156 | + - name: Run OpenAPI Breaking Change Diff Against OpenAI API |
| 157 | + if: steps.skip-check.outputs.skip != 'true' |
| 158 | + continue-on-error: true |
| 159 | + shell: bash |
| 160 | + run: | |
| 161 | + OPENAI_SPEC=~/openai-openapi/openai-openapi.yml |
| 162 | + LOCAL_SPEC=docs/static/llama-stack-spec.yaml |
| 163 | +
|
| 164 | + oasdiff breaking --fail-on ERR \ |
| 165 | + "$OPENAI_SPEC" \ |
| 166 | + "$LOCAL_SPEC" \ |
| 167 | + --match-path "^/v1/.*" |
| 168 | +
|
140 | 169 | # Report when test is skipped |
141 | 170 | - name: Report skip reason |
142 | 171 | if: steps.skip-check.outputs.skip == 'true' |
|
0 commit comments