Speed up HTF creation #145
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 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 |