1name: Tests 2 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". 6on: 7 pull_request: 8 branches: 9 - master 10 - 3.8 11 - 3.7 12 13jobs: 14 check_source: 15 name: 'Check for source changes' 16 runs-on: ubuntu-latest 17 outputs: 18 run_tests: ${{ steps.check.outputs.run_tests }} 19 steps: 20 - uses: actions/checkout@v2 21 - name: Check for source changes 22 id: check 23 run: | 24 if [ -z "GITHUB_BASE_REF" ]; then 25 echo '::set-output name=run_tests::true' 26 else 27 git fetch origin $GITHUB_BASE_REF --depth=1 28 git diff --name-only origin/$GITHUB_BASE_REF... | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true 29 fi 30 build_win32: 31 name: 'Windows (x86)' 32 runs-on: windows-latest 33 needs: check_source 34 if: needs.check_source.outputs.run_tests == 'true' 35 steps: 36 - uses: actions/checkout@v2 37 - name: Build CPython 38 run: .\PCbuild\build.bat -e -p Win32 39 - name: Display build info 40 run: .\python.bat -m test.pythoninfo 41 - name: Tests 42 run: .\PCbuild\rt.bat -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0 43 44 build_win_amd64: 45 name: 'Windows (x64)' 46 runs-on: windows-latest 47 needs: check_source 48 if: needs.check_source.outputs.run_tests == 'true' 49 steps: 50 - uses: actions/checkout@v2 51 - name: Build CPython 52 run: .\PCbuild\build.bat -e -p x64 53 - name: Display build info 54 run: .\python.bat -m test.pythoninfo 55 - name: Tests 56 run: .\PCbuild\rt.bat -x64 -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0 57 58 build_macos: 59 name: 'macOS' 60 runs-on: macos-latest 61 needs: check_source 62 if: needs.check_source.outputs.run_tests == 'true' 63 steps: 64 - uses: actions/checkout@v2 65 - name: Configure CPython 66 run: ./configure --with-pydebug --with-openssl=/usr/local/opt/openssl --prefix=/opt/python-dev 67 - name: Build CPython 68 run: make -j4 69 - name: Display build info 70 run: make pythoninfo 71 - name: Tests 72 run: make buildbottest TESTOPTS="-j4 -uall,-cpu" 73 74 build_ubuntu: 75 name: 'Ubuntu' 76 runs-on: ubuntu-latest 77 needs: check_source 78 if: needs.check_source.outputs.run_tests == 'true' 79 env: 80 OPENSSL_VER: 1.1.1f 81 steps: 82 - uses: actions/checkout@v2 83 - name: Install Dependencies 84 run: sudo ./.github/workflows/posix-deps-apt.sh 85 - name: 'Restore OpenSSL build' 86 id: cache-openssl 87 uses: actions/cache@v1 88 with: 89 path: ./multissl/openssl/${{ env.OPENSSL_VER }} 90 key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }} 91 - name: Install OpenSSL 92 if: steps.cache-openssl.outputs.cache-hit != 'true' 93 run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $PWD/multissl --openssl $OPENSSL_VER --system Linux 94 - name: Configure CPython 95 run: ./configure --with-pydebug --with-openssl=$PWD/multissl/openssl/$OPENSSL_VER 96 - name: Build CPython 97 run: make -j4 98 - name: Display build info 99 run: make pythoninfo 100 - name: Tests 101 run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu" 102