Move code to vcs versioning #177
Workflow file for this run
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: API Stability Check | |
on: | |
pull_request: | |
push: | |
branches: | |
- "*" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
env: | |
FORCE_COLOR: 1 | |
jobs: | |
api-check: | |
name: Check API stability with griffe | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
with: | |
fetch-depth: 0 | |
- name: Setup Python | |
uses: actions/setup-python@v6 | |
with: | |
python-version: '3.11' | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@v6 | |
- name: Install dependencies | |
run: | | |
uv sync --group test | |
uv pip install griffe | |
- name: Run griffe API check | |
id: griffe-check | |
continue-on-error: true | |
run: | | |
echo "Running griffe API stability check..." | |
if uv run griffe check setuptools_scm -ssrc -f github; then | |
echo "api_check_result=success" >> $GITHUB_OUTPUT | |
echo "exit_code=0" >> $GITHUB_OUTPUT | |
else | |
exit_code=$? | |
echo "api_check_result=warning" >> $GITHUB_OUTPUT | |
echo "exit_code=$exit_code" >> $GITHUB_OUTPUT | |
exit $exit_code | |
fi | |
- name: Report API check result | |
if: always() | |
uses: actions/github-script@v8 | |
with: | |
script: | | |
const result = '${{ steps.griffe-check.outputs.api_check_result }}' | |
const exitCode = '${{ steps.griffe-check.outputs.exit_code }}' | |
if (result === 'success') { | |
core.notice('API stability check passed - no breaking changes detected') | |
await core.summary | |
.addHeading('✅ API Stability Check: Passed', 2) | |
.addRaw('No breaking changes detected in the public API') | |
.write() | |
} else if (result === 'warning') { | |
core.warning(`API stability check detected breaking changes (exit code: ${exitCode}). Please review the API changes above.`) | |
await core.summary | |
.addHeading('⚠️ API Stability Warning', 2) | |
.addRaw('Breaking changes detected in the public API. Please review the changes reported above.') | |
.addRaw(`\n\nExit code: ${exitCode}`) | |
.write() | |
} else { | |
core.error('API stability check failed to run properly') | |
await core.summary | |
.addHeading('❌ API Stability Check: Failed', 2) | |
.addRaw('The griffe check failed to execute. This may indicate griffe is not installed or there was an error.') | |
.write() | |
} |