Skip to content

Commit 2bc2aae

Browse files
[3.12] gh-125741: Update check_generated_files CI to use our published container image (gh-125744) (#125760)
(cherry picked from commit ed24702) Co-authored-by: Donghee Na <[email protected]>
1 parent 8cc8d7d commit 2bc2aae

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
@@ -91,6 +91,50 @@ jobs:
9191
name: abi-data
9292
path: ./Doc/data/*.abi
9393

94+
check_autoconf_regen:
95+
name: 'Check if Autoconf files are up to date'
96+
# Don't use ubuntu-latest but a specific version to make the job
97+
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
98+
runs-on: ubuntu-24.04
99+
container:
100+
image: ghcr.io/python/autoconf:2024.10.11.11293396815
101+
timeout-minutes: 60
102+
needs: check_source
103+
if: needs.check_source.outputs.run_tests == 'true'
104+
steps:
105+
- name: Install Git
106+
run: |
107+
apt install git -yq
108+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
109+
- uses: actions/checkout@v4
110+
with:
111+
fetch-depth: 1
112+
- name: Runner image version
113+
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
114+
- name: Check Autoconf and aclocal versions
115+
run: |
116+
grep "Generated by GNU Autoconf 2.71" configure
117+
grep "aclocal 1.16.5" aclocal.m4
118+
grep -q "runstatedir" configure
119+
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
120+
- name: Regenerate autoconf files
121+
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
122+
run: autoreconf -ivf -Werror
123+
- name: Check for changes
124+
run: |
125+
git add -u
126+
changes=$(git status --porcelain)
127+
# Check for changes in regenerated files
128+
if test -n "$changes"; then
129+
echo "Generated files not up to date."
130+
echo "Perhaps you forgot to run make regen-all or build.bat --regen. ;)"
131+
echo "configure files must be regenerated with a specific version of autoconf."
132+
echo "$changes"
133+
echo ""
134+
git diff --staged || true
135+
exit 1
136+
fi
137+
94138
check_generated_files:
95139
name: 'Check if generated files are up to date'
96140
# Don't use ubuntu-latest but a specific version to make the job
@@ -119,19 +163,10 @@ jobs:
119163
uses: hendrikmuhs/[email protected]
120164
with:
121165
save: false
122-
- name: Check Autoconf and aclocal versions
123-
run: |
124-
grep "Generated by GNU Autoconf 2.71" configure
125-
grep "aclocal 1.16.5" aclocal.m4
126-
grep -q "runstatedir" configure
127-
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
128166
- name: Configure CPython
129167
run: |
130168
# Build Python with the libpython dynamic library
131169
./configure --config-cache --with-pydebug --enable-shared
132-
- name: Regenerate autoconf files
133-
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
134-
run: autoreconf -ivf -Werror
135170
- name: Build CPython
136171
run: |
137172
# Deepfreeze will usually cause global objects to be added or removed,

0 commit comments

Comments
 (0)