|
43 | 43 | if: fromJSON(needs.build-context.outputs.run-docs)
|
44 | 44 | uses: ./.github/workflows/reusable-docs.yml
|
45 | 45 |
|
| 46 | + check-abi: |
| 47 | + name: 'Check if the ABI has changed' |
| 48 | + runs-on: ubuntu-22.04 # 24.04 causes spurious errors |
| 49 | + needs: build-context |
| 50 | + if: needs.build-context.outputs.run-tests == 'true' |
| 51 | + steps: |
| 52 | + - uses: actions/checkout@v4 |
| 53 | + with: |
| 54 | + persist-credentials: false |
| 55 | + - uses: actions/setup-python@v5 |
| 56 | + with: |
| 57 | + python-version: '3.x' |
| 58 | + - name: Install dependencies |
| 59 | + run: | |
| 60 | + sudo ./.github/workflows/posix-deps-apt.sh |
| 61 | + sudo apt-get install -yq abigail-tools |
| 62 | + - name: Build CPython |
| 63 | + env: |
| 64 | + CFLAGS: -g3 -O0 |
| 65 | + run: | |
| 66 | + # Build Python with the libpython dynamic library |
| 67 | + ./configure --enable-shared |
| 68 | + make -j4 |
| 69 | + - name: Check for changes in the ABI |
| 70 | + id: check |
| 71 | + run: | |
| 72 | + if ! make check-abidump; then |
| 73 | + echo "Generated ABI file is not up to date." |
| 74 | + echo "Please add the release manager of this branch as a reviewer of this PR." |
| 75 | + echo "" |
| 76 | + echo "The up to date ABI file should be attached to this build as an artifact." |
| 77 | + echo "" |
| 78 | + echo "To learn more about this check: https://devguide.python.org/getting-started/setup-building/index.html#regenerate-the-abi-dump" |
| 79 | + echo "" |
| 80 | + exit 1 |
| 81 | + fi |
| 82 | + - name: Generate updated ABI files |
| 83 | + if: ${{ failure() && steps.check.conclusion == 'failure' }} |
| 84 | + run: | |
| 85 | + make regen-abidump |
| 86 | + - uses: actions/upload-artifact@v4 |
| 87 | + name: Publish updated ABI files |
| 88 | + if: ${{ failure() && steps.check.conclusion == 'failure' }} |
| 89 | + with: |
| 90 | + name: abi-data |
| 91 | + path: ./Doc/data/*.abi |
| 92 | + |
46 | 93 | check-autoconf-regen:
|
47 | 94 | name: 'Check if Autoconf files are up to date'
|
48 | 95 | # Don't use ubuntu-latest but a specific version to make the job
|
|
0 commit comments