-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (43 loc) · 1.57 KB
/
_reusable-check-api-for-breaking-changes.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
name: Check Public API for Breaking Changes
on:
workflow_call:
inputs:
package-name:
description: The name of the package to check.
required: true
type: string
jobs:
check-api-for-breaking-changes:
name: Check API for breaking changes
runs-on: ubuntu-latest
env:
PACKAGE_NAME: ${{ inputs.package-name }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version-file: pyproject.toml
- name: Install package to check
run: |
pip install --upgrade .
pip install griffe
- name: Post breaking changes as GitHub annotations
continue-on-error: true
run: |
griffe check --format=github --against="$(git rev-parse origin/main)" --search=src "$PACKAGE_NAME"
- name: Check API for breaking changes
continue-on-error: true
run: |
echo "## Breaking API Changes" > breaking_changes.md
echo "\`\`\`" >> breaking_changes.md
griffe check --format=verbose --against="$(git rev-parse origin/main)" --search=src "$PACKAGE_NAME" 2>&1 | tee -a breaking_changes.md
- name: Finish writing summary file
run: echo "\`\`\`" >> breaking_changes.md
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: breaking_changes
path: breaking_changes.md