|
42 | 42 |
|
43 | 43 | check_abi:
|
44 | 44 | name: 'Check if the ABI has changed'
|
45 |
| - runs-on: ubuntu-latest |
| 45 | + runs-on: ubuntu-22.04 |
46 | 46 | needs: check_source
|
47 | 47 | if: needs.check_source.outputs.run_tests == 'true'
|
48 | 48 | steps:
|
|
83 | 83 | name: abi-data
|
84 | 84 | path: ./Doc/data/*.abi
|
85 | 85 |
|
| 86 | + check_autoconf_regen: |
| 87 | + name: 'Check if Autoconf files are up to date' |
| 88 | + # Don't use ubuntu-latest but a specific version to make the job |
| 89 | + # reproducible: to get the same tools versions (autoconf, aclocal, ...) |
| 90 | + runs-on: ubuntu-24.04 |
| 91 | + container: |
| 92 | + image: ghcr.io/python/autoconf:2024.10.11.11293396815 |
| 93 | + timeout-minutes: 60 |
| 94 | + needs: check_source |
| 95 | + if: needs.check_source.outputs.run_tests == 'true' |
| 96 | + steps: |
| 97 | + - name: Install Git |
| 98 | + run: | |
| 99 | + apt install git -yq |
| 100 | + git config --global --add safe.directory "$GITHUB_WORKSPACE" |
| 101 | + - uses: actions/checkout@v4 |
| 102 | + with: |
| 103 | + fetch-depth: 1 |
| 104 | + - name: Runner image version |
| 105 | + run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV |
| 106 | + - name: Check Autoconf and aclocal versions |
| 107 | + run: | |
| 108 | + grep "Generated by GNU Autoconf 2.71" configure |
| 109 | + grep "aclocal 1.16.5" aclocal.m4 |
| 110 | + grep -q "runstatedir" configure |
| 111 | + grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4 |
| 112 | + - name: Regenerate autoconf files |
| 113 | + # Same command used by Tools/build/regen-configure.sh ($AUTORECONF) |
| 114 | + run: autoreconf -ivf -Werror |
| 115 | + - name: Check for changes |
| 116 | + run: | |
| 117 | + git add -u |
| 118 | + changes=$(git status --porcelain) |
| 119 | + # Check for changes in regenerated files |
| 120 | + if test -n "$changes"; then |
| 121 | + echo "Generated files not up to date." |
| 122 | + echo "Perhaps you forgot to run make regen-all or build.bat --regen. ;)" |
| 123 | + echo "configure files must be regenerated with a specific version of autoconf." |
| 124 | + echo "$changes" |
| 125 | + echo "" |
| 126 | + git diff --staged || true |
| 127 | + exit 1 |
| 128 | + fi |
| 129 | +
|
86 | 130 | check_generated_files:
|
87 | 131 | name: 'Check if generated files are up to date'
|
88 | 132 | # Don't use ubuntu-latest but a specific version to make the job
|
@@ -112,19 +156,10 @@ jobs:
|
112 | 156 | uses: hendrikmuhs/[email protected]
|
113 | 157 | with:
|
114 | 158 | save: false
|
115 |
| - - name: Check Autoconf and aclocal versions |
116 |
| - run: | |
117 |
| - grep "Generated by GNU Autoconf 2.71" configure |
118 |
| - grep "aclocal 1.16.5" aclocal.m4 |
119 |
| - grep -q "runstatedir" configure |
120 |
| - grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4 |
121 | 159 | - name: Configure CPython
|
122 | 160 | run: |
|
123 | 161 | # Build Python with the libpython dynamic library
|
124 | 162 | ./configure --config-cache --with-pydebug --enable-shared
|
125 |
| - - name: Regenerate autoconf files |
126 |
| - # Same command used by Tools/build/regen-configure.sh ($AUTORECONF) |
127 |
| - run: autoreconf -ivf -Werror |
128 | 163 | - name: Build CPython
|
129 | 164 | run: |
|
130 | 165 | make -j4 regen-all
|
@@ -543,6 +578,7 @@ jobs:
|
543 | 578 | needs:
|
544 | 579 | - check_source # Transitive dependency, needed to access `run_tests` value
|
545 | 580 | - check-docs
|
| 581 | + - check_autoconf_regen |
546 | 582 | - check_generated_files
|
547 | 583 | - build_macos
|
548 | 584 | - build_ubuntu
|
@@ -578,6 +614,7 @@ jobs:
|
578 | 614 | ${{
|
579 | 615 | needs.check_source.outputs.run_tests != 'true'
|
580 | 616 | && '
|
| 617 | + check_autoconf_regen, |
581 | 618 | check_generated_files,
|
582 | 619 | build_macos,
|
583 | 620 | build_ubuntu,
|
|
0 commit comments