Publish bounded v1 goal and lifecycle contracts #4
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: Compatibility | |
| on: | |
| pull_request: | |
| paths: | |
| - "schemas/**" | |
| - "scripts/compatibility.mjs" | |
| - "scripts/lib.mjs" | |
| - "tests/compatibility.test.mjs" | |
| - ".github/workflows/compatibility.yml" | |
| permissions: | |
| contents: read | |
| jobs: | |
| classify: | |
| name: Classify schema compatibility | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Check out proposed contracts | |
| uses: actions/checkout@v4 | |
| with: | |
| path: candidate | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: candidate/package-lock.json | |
| - run: npm ci | |
| working-directory: candidate | |
| - name: Extract latest released contracts | |
| shell: bash | |
| working-directory: candidate | |
| run: | | |
| set -euo pipefail | |
| latest="$(git tag --list "v[0-9]*.[0-9]*.[0-9]*" --sort=-version:refname | head -n 1)" | |
| test -n "$latest" | |
| mkdir -p ../baseline | |
| git archive "$latest" schemas | tar -x -C ../baseline | |
| - name: Classify changes | |
| id: classify | |
| shell: bash | |
| run: | | |
| set +e | |
| node candidate/scripts/compatibility.mjs \ | |
| --base baseline/schemas \ | |
| --head candidate/schemas \ | |
| --output candidate/compatibility-report.json | |
| code=$? | |
| { | |
| echo "## Compatibility against latest release" | |
| echo '```json' | |
| cat candidate/compatibility-report.json | |
| echo '```' | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| exit "$code" | |
| - name: Upload compatibility report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: compatibility-report | |
| path: candidate/compatibility-report.json |