openai/openai-java
Publicmirrored from https://github.com/openai/openai-javaAvailable
.github/workflows/detect-breaking-changes.yml
39lines · modeblame
2f6940a4stainless-app[bot]11 months ago | 1 | name: CI |
| 2 | on: | |
| 3 | pull_request: | |
| 4 | branches: | |
| 5 | - main | |
| 6 | - next | |
| 7 | | |
| 8 | jobs: | |
| 9 | detect_breaking_changes: | |
| 10 | runs-on: 'ubuntu-latest' | |
| 11 | name: detect-breaking-changes | |
| 12 | if: github.repository == 'openai/openai-java' | |
| 13 | steps: | |
| 14 | - name: Calculate fetch-depth | |
| 15 | run: | | |
| 16 | echo "FETCH_DEPTH=$(expr ${{ github.event.pull_request.commits }} + 1)" >> $GITHUB_ENV | |
| 17 | | |
3349f806Drew Hintz4 months ago | 18 | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
2f6940a4stainless-app[bot]11 months ago | 19 | with: |
| 20 | # Ensure we can check out the pull request base in the script below. | |
| 21 | fetch-depth: ${{ env.FETCH_DEPTH }} | |
| 22 | | |
| 23 | - name: Set up Java | |
3349f806Drew Hintz4 months ago | 24 | uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 |
2f6940a4stainless-app[bot]11 months ago | 25 | with: |
| 26 | distribution: temurin | |
| 27 | java-version: | | |
| 28 | 8 | |
| 29 | 21 | |
| 30 | cache: gradle | |
| 31 | - name: Set up Gradle | |
3349f806Drew Hintz4 months ago | 32 | uses: gradle/gradle-build-action@fe583dc97e032f41ccc310ea5176f2d7306abbc4 # v2 |
2f6940a4stainless-app[bot]11 months ago | 33 | |
| 34 | - name: Detect breaking changes | |
| 35 | run: | | |
| 36 | # Try to check out previous versions of the breaking change detection script. This ensures that | |
| 37 | # we still detect breaking changes when entire files and their tests are removed. | |
| 38 | git checkout "${{ github.event.pull_request.base.sha }}" -- ./scripts/detect-breaking-changes 2>/dev/null || true | |
| 39 | ./scripts/detect-breaking-changes ${{ github.event.pull_request.base.sha }} |