@@ -40,15 +40,55 @@ jobs:
40
40
if : fromJSON(needs.check_source.outputs.run-docs)
41
41
uses : ./.github/workflows/reusable-docs.yml
42
42
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'
45
45
# Don't use ubuntu-latest but a specific version to make the job
46
46
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
47
47
runs-on : ubuntu-24.04
48
48
container :
49
49
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
52
92
timeout-minutes : 60
53
93
needs : check_source
54
94
if : needs.check_source.outputs.run_tests == 'true'
@@ -66,26 +106,17 @@ jobs:
66
106
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
67
107
key : ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }}
68
108
- name : Install Dependencies
69
- run : ./.github/workflows/posix-deps-apt.sh
109
+ run : sudo ./.github/workflows/posix-deps-apt.sh
70
110
- name : Add ccache to PATH
71
111
run : echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
72
112
- name : Configure ccache action
73
113
uses :
hendrikmuhs/[email protected]
74
114
with :
75
115
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
82
116
- name : Configure CPython
83
117
run : |
84
118
# Build Python with the libpython dynamic library
85
119
./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
89
120
- name : Build CPython
90
121
run : |
91
122
make -j4 regen-all
0 commit comments