Skip to content

Commit 4396956

Browse files
committed
Separate workflow for autoconf temporary
1 parent 3a54872 commit 4396956

File tree

1 file changed

+45
-14
lines changed

1 file changed

+45
-14
lines changed

.github/workflows/build.yml

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,55 @@ jobs:
4040
if: fromJSON(needs.check_source.outputs.run-docs)
4141
uses: ./.github/workflows/reusable-docs.yml
4242

43-
check_generated_files:
44-
name: 'Check if generated files are up to date'
43+
check_autoconf_regen:
44+
name: 'Check if Autoconf files are up to date'
4545
# Don't use ubuntu-latest but a specific version to make the job
4646
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
4747
runs-on: ubuntu-24.04
4848
container:
4949
image: ghcr.io/python/autoconf:2024.10.11.11293396815
50-
env:
51-
DEBIAN_FRONTEND: noninteractive
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+
87+
check_generated_files:
88+
name: 'Check if generated files are up to date'
89+
# Don't use ubuntu-latest but a specific version to make the job
90+
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
91+
runs-on: ubuntu-22.04
5292
timeout-minutes: 60
5393
needs: check_source
5494
if: needs.check_source.outputs.run_tests == 'true'
@@ -66,26 +106,17 @@ jobs:
66106
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
67107
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }}
68108
- name: Install Dependencies
69-
run: ./.github/workflows/posix-deps-apt.sh
109+
run: sudo ./.github/workflows/posix-deps-apt.sh
70110
- name: Add ccache to PATH
71111
run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
72112
- name: Configure ccache action
73113
uses: hendrikmuhs/[email protected]
74114
with:
75115
save: false
76-
- name: Check Autoconf and aclocal versions
77-
run: |
78-
grep "Generated by GNU Autoconf 2.71" configure
79-
grep "aclocal 1.16.5" aclocal.m4
80-
grep -q "runstatedir" configure
81-
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
82116
- name: Configure CPython
83117
run: |
84118
# Build Python with the libpython dynamic library
85119
./configure --config-cache --with-pydebug --enable-shared
86-
- name: Regenerate autoconf files
87-
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
88-
run: autoreconf -ivf -Werror
89120
- name: Build CPython
90121
run: |
91122
make -j4 regen-all

0 commit comments

Comments
 (0)