2019-12-16 14:35:22 -04:00
|
|
|
name: Tests
|
|
|
|
|
2020-05-07 17:42:14 -03:00
|
|
|
# bpo-40548: "paths-ignore" is not used to skip documentation-only PRs, because
|
|
|
|
# it prevents to mark a job as mandatory. A PR cannot be merged if a job is
|
|
|
|
# mandatory but not scheduled because of "paths-ignore".
|
2019-12-16 14:35:22 -04:00
|
|
|
on:
|
2019-12-16 15:15:08 -04:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2020-05-19 14:01:32 -03:00
|
|
|
- 3.9
|
2019-12-16 15:15:08 -04:00
|
|
|
- 3.8
|
|
|
|
- 3.7
|
2019-12-16 14:35:22 -04:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
2020-05-19 14:01:32 -03:00
|
|
|
- 3.9
|
2019-12-16 14:35:22 -04:00
|
|
|
- 3.8
|
|
|
|
- 3.7
|
|
|
|
|
|
|
|
jobs:
|
2020-05-14 19:11:40 -03:00
|
|
|
check_source:
|
|
|
|
name: 'Check for source changes'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
run_tests: ${{ steps.check.outputs.run_tests }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Check for source changes
|
|
|
|
id: check
|
|
|
|
run: |
|
|
|
|
if [ -z "GITHUB_BASE_REF" ]; then
|
|
|
|
echo '::set-output name=run_tests::true'
|
|
|
|
else
|
|
|
|
git fetch origin $GITHUB_BASE_REF --depth=1
|
2020-08-10 13:36:59 -03:00
|
|
|
# git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more
|
|
|
|
# reliable than git diff "origin/$GITHUB_BASE_REF.." (2 dots),
|
|
|
|
# but it requires to download more commits (this job uses
|
|
|
|
# "git fetch --depth=1").
|
|
|
|
#
|
|
|
|
# git diff "origin/$GITHUB_BASE_REF..." (3 dots) works with Git
|
|
|
|
# 2.26, but Git 2.28 is stricter and fails with "no merge base".
|
|
|
|
#
|
|
|
|
# git diff "origin/$GITHUB_BASE_REF.." (2 dots) should be enough on
|
|
|
|
# GitHub, since GitHub starts by merging origin/$GITHUB_BASE_REF
|
|
|
|
# into the PR branch anyway.
|
|
|
|
#
|
|
|
|
# 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
|
2020-05-14 19:11:40 -03:00
|
|
|
fi
|
2020-11-20 10:14:16 -04:00
|
|
|
|
|
|
|
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@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
- name: Install Dependencies
|
|
|
|
run: sudo ./.github/workflows/posix-deps-apt.sh
|
|
|
|
- name: Build CPython
|
|
|
|
run: |
|
2020-11-24 08:38:08 -04:00
|
|
|
# Build Python with the libpython dynamic library
|
|
|
|
./configure --with-pydebug --enable-shared
|
2020-11-20 10:14:16 -04:00
|
|
|
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
|
|
|
|
|
2019-12-16 14:35:22 -04:00
|
|
|
build_win32:
|
|
|
|
name: 'Windows (x86)'
|
|
|
|
runs-on: windows-latest
|
2020-05-14 19:11:40 -03:00
|
|
|
needs: check_source
|
|
|
|
if: needs.check_source.outputs.run_tests == 'true'
|
2019-12-16 14:35:22 -04:00
|
|
|
steps:
|
2020-05-18 09:52:45 -03:00
|
|
|
- uses: actions/checkout@v2
|
2019-12-16 14:35:22 -04:00
|
|
|
- name: Build CPython
|
|
|
|
run: .\PCbuild\build.bat -e -p Win32
|
|
|
|
- name: Display build info
|
|
|
|
run: .\python.bat -m test.pythoninfo
|
|
|
|
- name: Tests
|
2020-11-18 13:24:36 -04:00
|
|
|
run: .\PCbuild\rt.bat -p Win32 -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
|
2019-12-16 14:35:22 -04:00
|
|
|
|
|
|
|
build_win_amd64:
|
|
|
|
name: 'Windows (x64)'
|
|
|
|
runs-on: windows-latest
|
2020-05-14 19:11:40 -03:00
|
|
|
needs: check_source
|
|
|
|
if: needs.check_source.outputs.run_tests == 'true'
|
2019-12-16 14:35:22 -04:00
|
|
|
steps:
|
2020-05-18 09:52:45 -03:00
|
|
|
- uses: actions/checkout@v2
|
2019-12-16 14:35:22 -04:00
|
|
|
- name: Build CPython
|
|
|
|
run: .\PCbuild\build.bat -e -p x64
|
|
|
|
- name: Display build info
|
|
|
|
run: .\python.bat -m test.pythoninfo
|
|
|
|
- name: Tests
|
2020-11-18 13:24:36 -04:00
|
|
|
run: .\PCbuild\rt.bat -p x64 -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
|
2019-12-16 14:35:22 -04:00
|
|
|
|
|
|
|
build_macos:
|
|
|
|
name: 'macOS'
|
|
|
|
runs-on: macos-latest
|
2020-05-14 19:11:40 -03:00
|
|
|
needs: check_source
|
|
|
|
if: needs.check_source.outputs.run_tests == 'true'
|
2019-12-16 14:35:22 -04:00
|
|
|
steps:
|
2020-05-18 09:52:45 -03:00
|
|
|
- uses: actions/checkout@v2
|
2019-12-16 14:35:22 -04:00
|
|
|
- name: Configure CPython
|
|
|
|
run: ./configure --with-pydebug --with-openssl=/usr/local/opt/openssl --prefix=/opt/python-dev
|
|
|
|
- name: Build CPython
|
2020-02-26 15:21:41 -04:00
|
|
|
run: make -j4
|
2019-12-16 14:35:22 -04:00
|
|
|
- name: Display build info
|
|
|
|
run: make pythoninfo
|
|
|
|
- name: Tests
|
|
|
|
run: make buildbottest TESTOPTS="-j4 -uall,-cpu"
|
|
|
|
|
|
|
|
build_ubuntu:
|
|
|
|
name: 'Ubuntu'
|
|
|
|
runs-on: ubuntu-latest
|
2020-05-14 19:11:40 -03:00
|
|
|
needs: check_source
|
|
|
|
if: needs.check_source.outputs.run_tests == 'true'
|
2019-12-16 14:35:22 -04:00
|
|
|
env:
|
2020-04-02 22:05:10 -03:00
|
|
|
OPENSSL_VER: 1.1.1f
|
2019-12-16 14:35:22 -04:00
|
|
|
steps:
|
2020-05-18 09:52:45 -03:00
|
|
|
- uses: actions/checkout@v2
|
2020-06-06 08:21:46 -03:00
|
|
|
- name: Register gcc problem matcher
|
|
|
|
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
|
2019-12-16 14:35:22 -04:00
|
|
|
- name: Install Dependencies
|
|
|
|
run: sudo ./.github/workflows/posix-deps-apt.sh
|
|
|
|
- name: 'Restore OpenSSL build'
|
|
|
|
id: cache-openssl
|
2020-10-23 18:29:41 -03:00
|
|
|
uses: actions/cache@v2.1.2
|
2019-12-16 14:35:22 -04:00
|
|
|
with:
|
|
|
|
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
|
|
|
|
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
|
|
|
|
- name: Install OpenSSL
|
|
|
|
if: steps.cache-openssl.outputs.cache-hit != 'true'
|
|
|
|
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $PWD/multissl --openssl $OPENSSL_VER --system Linux
|
|
|
|
- name: Configure CPython
|
|
|
|
run: ./configure --with-pydebug --with-openssl=$PWD/multissl/openssl/$OPENSSL_VER
|
|
|
|
- name: Build CPython
|
2020-02-26 15:21:41 -04:00
|
|
|
run: make -j4
|
2019-12-16 14:35:22 -04:00
|
|
|
- name: Display build info
|
|
|
|
run: make pythoninfo
|
|
|
|
- name: Tests
|
|
|
|
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
|