[Python-checkins] (no subject)

Filipe Laíns webhook-mailer at python.org
Thu May 14 18:11:48 EDT 2020




To: python-checkins at python.org
Subject:
 bpo-40548: GitHub Action workflow: skip jobs on doc only PRs (GH-19983)
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

https://github.com/python/cpython/commit/75d7257b201a56f950c20cd9f5753a83fff4=
742b
commit: 75d7257b201a56f950c20cd9f5753a83fff4742b
branch: master
author: Filipe La=C3=ADns <filipe.lains at gmail.com>
committer: GitHub <noreply at github.com>
date: 2020-05-15T00:11:40+02:00
summary:

bpo-40548: GitHub Action workflow: skip jobs on doc only PRs (GH-19983)

Signed-off-by: Filipe La=C3=ADns <lains at archlinux.org>

files:
M .github/workflows/build.yml

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 6e6a6d2b789d3..dabfb79e9dcea 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -16,9 +16,27 @@ on:
     - 3.7
=20
 jobs:
+  check_source:
+    name: 'Check for source changes'
+    runs-on: ubuntu-latest
+    outputs:
+      run_tests: ${{ steps.check.outputs.run_tests }}
+    steps:
+      - uses: actions/checkout at v2
+      - name: Check for source changes
+        id: check
+        run: |
+          if [ -z "GITHUB_BASE_REF" ]; then
+            echo '::set-output name=3Drun_tests::true'
+          else
+            git fetch origin $GITHUB_BASE_REF --depth=3D1
+            git diff --name-only origin/$GITHUB_BASE_REF... | grep -qvE '(\.=
rst$|^Doc|^Misc)' && echo '::set-output name=3Drun_tests::true'
+          fi
   build_win32:
     name: 'Windows (x86)'
     runs-on: windows-latest
+    needs: check_source
+    if: needs.check_source.outputs.run_tests =3D=3D 'true'
     steps:
     - uses: actions/checkout at v1
     - name: Build CPython
@@ -31,6 +49,8 @@ jobs:
   build_win_amd64:
     name: 'Windows (x64)'
     runs-on: windows-latest
+    needs: check_source
+    if: needs.check_source.outputs.run_tests =3D=3D 'true'
     steps:
     - uses: actions/checkout at v1
     - name: Build CPython
@@ -43,6 +63,8 @@ jobs:
   build_macos:
     name: 'macOS'
     runs-on: macos-latest
+    needs: check_source
+    if: needs.check_source.outputs.run_tests =3D=3D 'true'
     steps:
     - uses: actions/checkout at v1
     - name: Configure CPython
@@ -57,6 +79,8 @@ jobs:
   build_ubuntu:
     name: 'Ubuntu'
     runs-on: ubuntu-latest
+    needs: check_source
+    if: needs.check_source.outputs.run_tests =3D=3D 'true'
     env:
       OPENSSL_VER: 1.1.1f
     steps:



More information about the Python-checkins mailing list