Skip to content

Commit ed24702

Browse files
authored
gh-125741: Update check_generated_files CI to use our published container image (gh-125744)
1 parent e924bb6 commit ed24702

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
@@ -40,6 +40,50 @@ jobs:
4040
if: fromJSON(needs.check_source.outputs.run-docs)
4141
uses: ./.github/workflows/reusable-docs.yml
4242

43+
check_autoconf_regen:
44+
name: 'Check if Autoconf files are up to date'
45+
# Don't use ubuntu-latest but a specific version to make the job
46+
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
47+
runs-on: ubuntu-24.04
48+
container:
49+
image: ghcr.io/python/autoconf:2024.10.11.11293396815
50+
timeout-minutes: 60
51+
needs: check_source
52+
if: needs.check_source.outputs.run_tests == 'true'
53+
steps:
54+
- name: Install Git
55+
run: |
56+
apt install git -yq
57+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
58+
- uses: actions/checkout@v4
59+
with:
60+
fetch-depth: 1
61+
- name: Runner image version
62+
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
63+
- name: Check Autoconf and aclocal versions
64+
run: |
65+
grep "Generated by GNU Autoconf 2.71" configure
66+
grep "aclocal 1.16.5" aclocal.m4
67+
grep -q "runstatedir" configure
68+
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
69+
- name: Regenerate autoconf files
70+
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
71+
run: autoreconf -ivf -Werror
72+
- name: Check for changes
73+
run: |
74+
git add -u
75+
changes=$(git status --porcelain)
76+
# Check for changes in regenerated files
77+
if test -n "$changes"; then
78+
echo "Generated files not up to date."
79+
echo "Perhaps you forgot to run make regen-all or build.bat --regen. ;)"
80+
echo "configure files must be regenerated with a specific version of autoconf."
81+
echo "$changes"
82+
echo ""
83+
git diff --staged || true
84+
exit 1
85+
fi
86+
4387
check_generated_files:
4488
name: 'Check if generated files are up to date'
4589
# Don't use ubuntu-latest but a specific version to make the job
@@ -69,19 +113,10 @@ jobs:
69113
uses: hendrikmuhs/[email protected]
70114
with:
71115
save: false
72-
- name: Check Autoconf and aclocal versions
73-
run: |
74-
grep "Generated by GNU Autoconf 2.71" configure
75-
grep "aclocal 1.16.5" aclocal.m4
76-
grep -q "runstatedir" configure
77-
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
78116
- name: Configure CPython
79117
run: |
80118
# Build Python with the libpython dynamic library
81119
./configure --config-cache --with-pydebug --enable-shared
82-
- name: Regenerate autoconf files
83-
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
84-
run: autoreconf -ivf -Werror
85120
- name: Build CPython
86121
run: |
87122
make -j4 regen-all

0 commit comments

Comments
 (0)