11name : Tests
22
3+ # bpo-40548: "paths-ignore" is not used to skip documentation-only PRs, because
4+ # it prevents to mark a job as mandatory. A PR cannot be merged if a job is
5+ # mandatory but not scheduled because of "paths-ignore".
36on :
47 push :
58 branches :
69 - master
10+ - 3.9
711 - 3.8
812 - 3.7
9- paths-ignore :
10- - ' Doc/**'
11- - ' Misc/**'
12- - ' **/*.md'
13- - ' **/*.rst'
1413 pull_request :
1514 branches :
1615 - master
16+ - 3.9
1717 - 3.8
1818 - 3.7
19- paths-ignore :
20- - ' Doc/**'
21- - ' Misc/**'
22- - ' **/*.md'
23- - ' **/*.rst'
2419
2520jobs :
21+ check_source :
22+ name : ' Check for source changes'
23+ runs-on : ubuntu-latest
24+ outputs :
25+ run_tests : ${{ steps.check.outputs.run_tests }}
26+ steps :
27+ - uses : actions/checkout@v2
28+ - name : Check for source changes
29+ id : check
30+ run : |
31+ if [ -z "GITHUB_BASE_REF" ]; then
32+ echo '::set-output name=run_tests::true'
33+ else
34+ git fetch origin $GITHUB_BASE_REF --depth=1
35+ git diff --name-only origin/$GITHUB_BASE_REF... | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true
36+ fi
2637 build_win32 :
2738 name : ' Windows (x86)'
2839 runs-on : windows-latest
40+ needs : check_source
41+ if : needs.check_source.outputs.run_tests == 'true'
2942 steps :
30- - uses : actions/checkout@v1
43+ - uses : actions/checkout@v2
3144 - name : Build CPython
3245 run : .\PCbuild\build.bat -e -p Win32
3346 - name : Display build info
3851 build_win_amd64 :
3952 name : ' Windows (x64)'
4053 runs-on : windows-latest
54+ needs : check_source
55+ if : needs.check_source.outputs.run_tests == 'true'
4156 steps :
42- - uses : actions/checkout@v1
57+ - uses : actions/checkout@v2
4358 - name : Build CPython
4459 run : .\PCbuild\build.bat -e -p x64
4560 - name : Display build info
5065 build_macos :
5166 name : ' macOS'
5267 runs-on : macos-latest
68+ needs : check_source
69+ if : needs.check_source.outputs.run_tests == 'true'
5370 steps :
54- - uses : actions/checkout@v1
71+ - uses : actions/checkout@v2
5572 - name : Configure CPython
5673 run : ./configure --with-pydebug --with-openssl=/usr/local/opt/openssl --prefix=/opt/python-dev
5774 - name : Build CPython
@@ -64,10 +81,14 @@ jobs:
6481 build_ubuntu :
6582 name : ' Ubuntu'
6683 runs-on : ubuntu-latest
84+ needs : check_source
85+ if : needs.check_source.outputs.run_tests == 'true'
6786 env :
68- OPENSSL_VER : 1.1.1d
87+ OPENSSL_VER : 1.1.1f
6988 steps :
70- - uses : actions/checkout@v1
89+ - uses : actions/checkout@v2
90+ - name : Register gcc problem matcher
91+ run : echo "::add-matcher::.github/problem-matchers/gcc.json"
7192 - name : Install Dependencies
7293 run : sudo ./.github/workflows/posix-deps-apt.sh
7394 - name : ' Restore OpenSSL build'
0 commit comments