Original file line numberDiff line numberDiff line change@@ -75,6 +75,36 @@ jobs:
7575 echo "run_hypothesis=true" >> $GITHUB_OUTPUT
7676 fi
777778+check_abi:
79+name: 'Check if the ABI has changed'
80+runs-on: ubuntu-22.04
81+needs: check_source
82+if: needs.check_source.outputs.run_tests == 'true'
83+steps:
84+ - uses: actions/checkout@v3
85+ - uses: actions/setup-python@v4
86+ - name: Install dependencies
87+run: |
88+ sudo ./.github/workflows/posix-deps-apt.sh
89+ sudo apt-get install -yq abigail-tools
90+ - name: Build CPython
91+env:
92+CFLAGS: -g3 -O0
93+run: |
94+ # Build Python with the libpython dynamic library
95+ ./configure --enable-shared
96+ make -j4
97+ - name: Check for changes in the ABI
98+run: |
99+ if ! make check-abidump; then
100+ echo "Generated ABI file is not up to date."
101+ echo "Please add the release manager of this branch as a reviewer of this PR."
102+ echo ""
103+ echo "To learn more about this check: https://devguide.python.org/setup/#regenerate-the-abi-dump"
104+ echo ""
105+ exit 1
106+ fi
107+78108check_generated_files:
79109name: 'Check if generated files are up to date'
80110runs-on: ubuntu-latest