Skip to content

Commit b55a276

Browse files
bpo-42212: Check if generated files are up-to-date in GitHub Actions (GH-23042)
See https: //github.com/python/core-workflow/issues/380 Signed-off-by: Filipe Laíns <lains@archlinux.org> (cherry picked from commit d20b7ed) Co-authored-by: Filipe Laíns <lains@archlinux.org>
1 parent ad49526 commit b55a276

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/build.yml

+28
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,34 @@ jobs:
4040
# https://github.com/python/core-workflow/issues/373
4141
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true
4242
fi
43+
44+
check_generated_files:
45+
name: 'Check if generated files are up to date'
46+
runs-on: ubuntu-latest
47+
needs: check_source
48+
if: needs.check_source.outputs.run_tests == 'true'
49+
steps:
50+
- uses: actions/checkout@v2
51+
- uses: actions/setup-python@v2
52+
- name: Install Dependencies
53+
run: sudo ./.github/workflows/posix-deps-apt.sh
54+
- name: Build CPython
55+
run: |
56+
./configure --with-pydebug
57+
make -j4 regen-all
58+
- name: Check for changes
59+
run: |
60+
changes=$(git status --porcelain)
61+
# Check for changes in regenerated files
62+
if ! test -z "$changes"
63+
then
64+
echo "Generated files not up to date. Perhaps you forgot to run make regen-all ;)"
65+
echo "$changes"
66+
exit 1
67+
fi
68+
- name: Check exported libpython symbols
69+
run: make smelly
70+
4371
build_win32:
4472
name: 'Windows (x86)'
4573
runs-on: windows-latest

0 commit comments

Comments
 (0)