[Python-checkins] bpo-42212: Check if generated files are up-to-date in GitHub Actions (GH-23042)

miss-islington webhook-mailer at python.org
Tue Nov 24 08:25:50 EST 2020


https://github.com/python/cpython/commit/b55a276a18e7c46f1e4e09fa24e9854deb0ed334
commit: b55a276a18e7c46f1e4e09fa24e9854deb0ed334
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2020-11-24T05:25:30-08:00
summary:

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 at archlinux.org>
(cherry picked from commit d20b7ed9c1fabac3fdebb7ec362fe4f022a54639)

Co-authored-by: Filipe Laíns <lains at archlinux.org>

files:
M .github/workflows/build.yml

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 3859cc3ecec8f..59a0d9a90a8f4 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -40,6 +40,34 @@ jobs:
             # https://github.com/python/core-workflow/issues/373
             git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true
           fi
+
+  check_generated_files:
+    name: 'Check if generated files are up to date'
+    runs-on: ubuntu-latest
+    needs: check_source
+    if: needs.check_source.outputs.run_tests == 'true'
+    steps:
+      - uses: actions/checkout at v2
+      - uses: actions/setup-python at v2
+      - name: Install Dependencies
+        run: sudo ./.github/workflows/posix-deps-apt.sh
+      - name: Build CPython
+        run: |
+          ./configure --with-pydebug
+          make -j4 regen-all
+      - name: Check for changes
+        run: |
+          changes=$(git status --porcelain)
+          # Check for changes in regenerated files
+          if ! test -z "$changes"
+          then
+            echo "Generated files not up to date. Perhaps you forgot to run make regen-all ;)"
+            echo "$changes"
+            exit 1
+          fi
+      - name: Check exported libpython symbols
+        run: make smelly
+
   build_win32:
     name: 'Windows (x86)'
     runs-on: windows-latest



More information about the Python-checkins mailing list