Skip to content

Commit a6d81b4

Browse files
[3.13] gh-125741: Update check_generated_files CI to use our published container image (gh-125744) (#125759)
(cherry picked from commit ed24702) Co-authored-by: Donghee Na <[email protected]>
1 parent 7711a1c commit a6d81b4

File tree

1 file changed

+44
-9
lines changed

1 file changed

+44
-9
lines changed

.github/workflows/build.yml

+44-9
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,50 @@ jobs:
8383
name: abi-data
8484
path: ./Doc/data/*.abi
8585

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+
86130
check_generated_files:
87131
name: 'Check if generated files are up to date'
88132
# Don't use ubuntu-latest but a specific version to make the job
@@ -112,19 +156,10 @@ jobs:
112156
uses: hendrikmuhs/[email protected]
113157
with:
114158
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
121159
- name: Configure CPython
122160
run: |
123161
# Build Python with the libpython dynamic library
124162
./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
128163
- name: Build CPython
129164
run: |
130165
make -j4 regen-all

0 commit comments

Comments
 (0)