Skip to content

Speed up HTF creation #145

Speed up HTF creation

Speed up HTF creation #145

name: "API break check"
on:
pull_request:
branches:
- main
permissions:
contents: read
defaults:
run:
shell: bash -leo pipefail {0}
jobs:
griffe:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Fetch base branch
run: |
git fetch --no-tags origin "${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}"
- uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: Run Griffe
id: griffe
run: |
python -m pip install -U griffe
mkdir -p api-break-result
set +e
{
echo '$ griffe check "openfe" -s src --no-inspection --no-color --verbose -a origin/${{ github.base_ref }}'
griffe check "openfe" -s src --no-inspection --no-color --verbose -a "origin/${{ github.base_ref }}"
s1=$?
echo
echo '$ griffe check "openfecli" -s src --no-inspection --no-color --verbose -a origin/${{ github.base_ref }}'
griffe check "openfecli" -s src --no-inspection --no-color --verbose -a "origin/${{ github.base_ref }}"
s2=$?
} > api-break-result/griffe.log 2>&1
status=0
if [ "$s1" -ne 0 ] || [ "$s2" -ne 0 ]; then
status=1
fi
echo "status=$status" >> "$GITHUB_OUTPUT"
- name: Upload Griffe result
if: always()
uses: actions/upload-artifact@v4
with:
name: api-break-result
path: api-break-result/
retention-days: 7
- name: Fail if API break detected
if: steps.griffe.outputs.status != '0'
run: exit 1