Skip to content

Commit d20b7ed

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

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
@@ -47,6 +47,34 @@ jobs:
4747
# https://github.com/python/core-workflow/issues/373
4848
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true
4949
fi
50+
51+
check_generated_files:
52+
name: 'Check if generated files are up to date'
53+
runs-on: ubuntu-latest
54+
needs: check_source
55+
if: needs.check_source.outputs.run_tests == 'true'
56+
steps:
57+
- uses: actions/checkout@v2
58+
- uses: actions/setup-python@v2
59+
- name: Install Dependencies
60+
run: sudo ./.github/workflows/posix-deps-apt.sh
61+
- name: Build CPython
62+
run: |
63+
./configure --with-pydebug
64+
make -j4 regen-all
65+
- name: Check for changes
66+
run: |
67+
changes=$(git status --porcelain)
68+
# Check for changes in regenerated files
69+
if ! test -z "$changes"
70+
then
71+
echo "Generated files not up to date. Perhaps you forgot to run make regen-all ;)"
72+
echo "$changes"
73+
exit 1
74+
fi
75+
- name: Check exported libpython symbols
76+
run: make smelly
77+
5078
build_win32:
5179
name: 'Windows (x86)'
5280
runs-on: windows-latest

0 commit comments

Comments
 (0)