Merge pull request #734 from Aiven-Open/dependabot/npm_and_yarn/websi… #451
This file contains 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: Check schema compatibility | |
on: | |
pull_request: | |
push: | |
branches: [ main ] | |
jobs: | |
check-generate-schema: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# Need fetch-depth 0 to fetch tags, see https://github.com/actions/checkout/issues/701 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
cache: pip | |
cache-dependency-path: | |
requirements.txt | |
- run: pip install -r requirements/requirements.txt | |
# Compare with latest release when running on main. | |
- run: make schema against=$(git describe --abbrev=0 --tags) | |
if: github.ref == 'refs/heads/main' | |
# Compare with main when running on branches/PRs. | |
- run: make schema | |
if: github.ref != 'refs/heads/main' | |
- run: | | |
diff=$(git --no-pager diff) | |
if [[ ! -z "$diff" ]]; then | |
echo "💥 Non-empty output from git diff, please run `make schema`." | |
echo | |
echo "$diff" | |
exit 1 | |
else | |
echo "✅ No diff after generating schema." | |
fi |