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