Skip to content

Commit 75d7257

Browse files
authored
bpo-40548: GitHub Action workflow: skip jobs on doc only PRs (GH-19983)
Signed-off-by: Filipe Laíns <lains@archlinux.org>
1 parent d2dc827 commit 75d7257

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,27 @@ on:
1616
- 3.7
1717

1818
jobs:
19+
check_source:
20+
name: 'Check for source changes'
21+
runs-on: ubuntu-latest
22+
outputs:
23+
run_tests: ${{ steps.check.outputs.run_tests }}
24+
steps:
25+
- uses: actions/checkout@v2
26+
- name: Check for source changes
27+
id: check
28+
run: |
29+
if [ -z "GITHUB_BASE_REF" ]; then
30+
echo '::set-output name=run_tests::true'
31+
else
32+
git fetch origin $GITHUB_BASE_REF --depth=1
33+
git diff --name-only origin/$GITHUB_BASE_REF... | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true'
34+
fi
1935
build_win32:
2036
name: 'Windows (x86)'
2137
runs-on: windows-latest
38+
needs: check_source
39+
if: needs.check_source.outputs.run_tests == 'true'
2240
steps:
2341
- uses: actions/checkout@v1
2442
- name: Build CPython
@@ -31,6 +49,8 @@ jobs:
3149
build_win_amd64:
3250
name: 'Windows (x64)'
3351
runs-on: windows-latest
52+
needs: check_source
53+
if: needs.check_source.outputs.run_tests == 'true'
3454
steps:
3555
- uses: actions/checkout@v1
3656
- name: Build CPython
@@ -43,6 +63,8 @@ jobs:
4363
build_macos:
4464
name: 'macOS'
4565
runs-on: macos-latest
66+
needs: check_source
67+
if: needs.check_source.outputs.run_tests == 'true'
4668
steps:
4769
- uses: actions/checkout@v1
4870
- name: Configure CPython
@@ -57,6 +79,8 @@ jobs:
5779
build_ubuntu:
5880
name: 'Ubuntu'
5981
runs-on: ubuntu-latest
82+
needs: check_source
83+
if: needs.check_source.outputs.run_tests == 'true'
6084
env:
6185
OPENSSL_VER: 1.1.1f
6286
steps:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy