|
40 | 40 | if: fromJSON(needs.check_source.outputs.run-docs)
|
41 | 41 | uses: ./.github/workflows/reusable-docs.yml
|
42 | 42 |
|
| 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 | +
|
43 | 87 | check_generated_files:
|
44 | 88 | name: 'Check if generated files are up to date'
|
45 | 89 | # Don't use ubuntu-latest but a specific version to make the job
|
@@ -69,19 +113,10 @@ jobs:
|
69 | 113 | uses: hendrikmuhs/[email protected]
|
70 | 114 | with:
|
71 | 115 | 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 |
78 | 116 | - name: Configure CPython
|
79 | 117 | run: |
|
80 | 118 | # Build Python with the libpython dynamic library
|
81 | 119 | ./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 |
85 | 120 | - name: Build CPython
|
86 | 121 | run: |
|
87 | 122 | make -j4 regen-all
|
|
0 commit comments