2019-12-16 18:35:22 +00:00
|
|
|
name: Tests
|
|
|
|
|
2020-05-07 20:42:14 +00: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 18:35:22 +00:00
|
|
|
on:
|
2019-12-16 19:15:08 +00:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2020-05-19 17:24:52 +00:00
|
|
|
- 3.9
|
2019-12-16 19:15:08 +00:00
|
|
|
- 3.8
|
|
|
|
- 3.7
|
2019-12-16 18:35:22 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
2020-05-19 17:24:52 +00:00
|
|
|
- 3.9
|
2019-12-16 18:35:22 +00:00
|
|
|
- 3.8
|
|
|
|
- 3.7
|
|
|
|
|
|
|
|
jobs:
|
2020-05-14 22:11:40 +00:00
|
|
|
check_source:
|
|
|
|
name: 'Check for source changes'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
run_tests: ${{ steps.check.outputs.run_tests }}
|
2021-04-13 19:14:41 +00:00
|
|
|
run_ssl_tests: ${{ steps.check.outputs.run_ssl_tests }}
|
2020-05-14 22:11:40 +00:00
|
|
|
steps:
|
2023-09-05 20:39:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2020-05-14 22:11:40 +00:00
|
|
|
- name: Check for source changes
|
|
|
|
id: check
|
|
|
|
run: |
|
2021-02-03 23:38:55 +00:00
|
|
|
if [ -z "$GITHUB_BASE_REF" ]; then
|
2020-05-14 22:11:40 +00:00
|
|
|
echo '::set-output name=run_tests::true'
|
2021-04-13 19:14:41 +00:00
|
|
|
echo '::set-output name=run_ssl_tests::true'
|
2020-05-14 22:11:40 +00:00
|
|
|
else
|
|
|
|
git fetch origin $GITHUB_BASE_REF --depth=1
|
2020-08-10 17:09:41 +00: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
|
2021-04-13 19:14:41 +00:00
|
|
|
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qE '(ssl|hashlib|hmac|^.github)' && echo '::set-output name=run_ssl_tests::true' || true
|
2020-05-14 22:11:40 +00:00
|
|
|
fi
|
2020-11-24 13:25:29 +00:00
|
|
|
|
2021-04-09 00:34:08 +00:00
|
|
|
check_abi:
|
|
|
|
name: 'Check if the ABI has changed'
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
needs: check_source
|
|
|
|
if: needs.check_source.outputs.run_tests == 'true'
|
|
|
|
steps:
|
2023-09-05 20:39:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v4
|
2021-04-09 00:34:08 +00:00
|
|
|
- name: Install Dependencies
|
|
|
|
run: |
|
|
|
|
sudo ./.github/workflows/posix-deps-apt.sh
|
|
|
|
sudo apt-get install -yq abigail-tools
|
|
|
|
- name: Build CPython
|
|
|
|
env:
|
|
|
|
CFLAGS: -g3 -O0
|
|
|
|
run: |
|
|
|
|
# Build Python with the libpython dynamic library
|
|
|
|
./configure --enable-shared
|
|
|
|
make -j4
|
|
|
|
- name: Check for changes in the ABI
|
|
|
|
run: make check-abidump
|
|
|
|
|
2020-11-24 13:25:29 +00: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:
|
2023-09-05 20:39:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v4
|
2020-11-24 13:25:29 +00:00
|
|
|
- name: Install Dependencies
|
|
|
|
run: sudo ./.github/workflows/posix-deps-apt.sh
|
2021-12-06 12:48:54 +00:00
|
|
|
- name: Add ccache to PATH
|
|
|
|
run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
|
|
|
|
- name: Configure ccache action
|
|
|
|
uses: hendrikmuhs/ccache-action@v1
|
|
|
|
- name: Check Autoconf version 2.69 and aclocal 1.16.3
|
|
|
|
run: |
|
|
|
|
grep "Generated by GNU Autoconf 2.69" configure
|
|
|
|
grep "aclocal 1.16.3" aclocal.m4
|
|
|
|
grep -q "runstatedir" configure
|
|
|
|
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
|
|
|
|
- name: Regenerate autoconf files
|
|
|
|
run: docker run --rm -v $(pwd):/src quay.io/tiran/cpython_autoconf:269
|
2020-11-24 13:25:29 +00:00
|
|
|
- name: Build CPython
|
|
|
|
run: |
|
|
|
|
./configure --with-pydebug
|
|
|
|
make -j4 regen-all
|
|
|
|
- name: Check for changes
|
|
|
|
run: |
|
|
|
|
changes=$(git status --porcelain)
|
|
|
|
# Check for changes in regenerated files
|
2021-12-06 12:48:54 +00:00
|
|
|
if test -n "$changes"; then
|
|
|
|
echo "Generated files not up to date."
|
|
|
|
echo "Perhaps you forgot to run make regen-all or build.bat --regen. ;)"
|
|
|
|
echo "configure files must be regenerated with a specific, unpatched version of autoconf."
|
2020-11-24 13:25:29 +00:00
|
|
|
echo "$changes"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
- name: Check exported libpython symbols
|
|
|
|
run: make smelly
|
|
|
|
|
2019-12-16 18:35:22 +00:00
|
|
|
build_win32:
|
|
|
|
name: 'Windows (x86)'
|
|
|
|
runs-on: windows-latest
|
2020-05-14 22:11:40 +00:00
|
|
|
needs: check_source
|
|
|
|
if: needs.check_source.outputs.run_tests == 'true'
|
2019-12-16 18:35:22 +00:00
|
|
|
steps:
|
2023-09-05 20:39:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2019-12-16 18:35:22 +00: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 17:45:54 +00:00
|
|
|
run: .\PCbuild\rt.bat -p Win32 -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
|
2019-12-16 18:35:22 +00:00
|
|
|
|
|
|
|
build_win_amd64:
|
|
|
|
name: 'Windows (x64)'
|
|
|
|
runs-on: windows-latest
|
2020-05-14 22:11:40 +00:00
|
|
|
needs: check_source
|
|
|
|
if: needs.check_source.outputs.run_tests == 'true'
|
2019-12-16 18:35:22 +00:00
|
|
|
steps:
|
2023-09-05 20:39:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2019-12-16 18:35:22 +00: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 17:45:54 +00:00
|
|
|
run: .\PCbuild\rt.bat -p x64 -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
|
2019-12-16 18:35:22 +00:00
|
|
|
|
|
|
|
build_macos:
|
|
|
|
name: 'macOS'
|
|
|
|
runs-on: macos-latest
|
2020-05-14 22:11:40 +00:00
|
|
|
needs: check_source
|
|
|
|
if: needs.check_source.outputs.run_tests == 'true'
|
2021-07-30 14:51:13 +00:00
|
|
|
env:
|
2023-06-05 06:23:32 +00:00
|
|
|
HOMEBREW_NO_ANALYTICS: 1
|
|
|
|
HOMEBREW_NO_AUTO_UPDATE: 1
|
|
|
|
HOMEBREW_NO_INSTALL_CLEANUP: 1
|
2021-07-30 14:51:13 +00:00
|
|
|
PYTHONSTRICTEXTENSIONBUILD: 1
|
2019-12-16 18:35:22 +00:00
|
|
|
steps:
|
2023-09-05 20:39:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-07-05 11:20:44 +00:00
|
|
|
- name: Install Homebrew dependencies
|
|
|
|
run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk
|
2019-12-16 18:35:22 +00:00
|
|
|
- name: Configure CPython
|
2023-06-05 06:23:32 +00:00
|
|
|
run: |
|
|
|
|
CC=clang \
|
|
|
|
CPPFLAGS="-I$(brew --prefix gdbm)/include -I$(brew --prefix xz)/include" \
|
|
|
|
LDFLAGS="-L$(brew --prefix gdbm)/lib -L$(brew --prefix xz)/lib" \
|
|
|
|
./configure --prefix=/opt/python-dev \
|
|
|
|
--with-pydebug \
|
2023-07-05 11:20:44 +00:00
|
|
|
--with-openssl="$(brew --prefix openssl@3.0)" \
|
2023-06-05 06:23:32 +00:00
|
|
|
--with-tcltk-libs="$(pkg-config --libs tk)" \
|
|
|
|
--with-tcltk-includes="$(pkg-config --cflags tk)"
|
2019-12-16 18:35:22 +00:00
|
|
|
- name: Build CPython
|
2020-02-26 19:21:41 +00:00
|
|
|
run: make -j4
|
2019-12-16 18:35:22 +00:00
|
|
|
- name: Display build info
|
|
|
|
run: make pythoninfo
|
|
|
|
- name: Tests
|
|
|
|
run: make buildbottest TESTOPTS="-j4 -uall,-cpu"
|
|
|
|
|
|
|
|
build_ubuntu:
|
|
|
|
name: 'Ubuntu'
|
2021-03-18 22:31:34 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2020-05-14 22:11:40 +00:00
|
|
|
needs: check_source
|
|
|
|
if: needs.check_source.outputs.run_tests == 'true'
|
2019-12-16 18:35:22 +00:00
|
|
|
env:
|
2023-08-22 18:28:57 +00:00
|
|
|
OPENSSL_VER: 1.1.1v
|
2021-07-30 14:51:13 +00:00
|
|
|
PYTHONSTRICTEXTENSIONBUILD: 1
|
2019-12-16 18:35:22 +00:00
|
|
|
steps:
|
2023-09-05 20:39:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2019-12-16 18:35:22 +00:00
|
|
|
- name: Install Dependencies
|
|
|
|
run: sudo ./.github/workflows/posix-deps-apt.sh
|
2021-04-13 19:14:41 +00:00
|
|
|
- name: Configure OpenSSL env vars
|
|
|
|
run: |
|
|
|
|
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
|
|
|
|
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
|
|
|
|
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
|
2019-12-16 18:35:22 +00:00
|
|
|
- name: 'Restore OpenSSL build'
|
|
|
|
id: cache-openssl
|
2022-05-01 23:46:15 +00:00
|
|
|
uses: actions/cache@v3.0.2
|
2019-12-16 18:35:22 +00: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'
|
2021-04-13 19:14:41 +00:00
|
|
|
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
|
|
|
|
- name: Add ccache to PATH
|
|
|
|
run: |
|
|
|
|
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
|
|
|
|
- name: Configure ccache action
|
|
|
|
uses: hendrikmuhs/ccache-action@v1
|
2019-12-16 18:35:22 +00:00
|
|
|
- name: Configure CPython
|
2021-04-13 19:14:41 +00:00
|
|
|
run: ./configure --with-pydebug --with-openssl=$OPENSSL_DIR
|
2019-12-16 18:35:22 +00:00
|
|
|
- name: Build CPython
|
2020-02-26 19:21:41 +00:00
|
|
|
run: make -j4
|
2019-12-16 18:35:22 +00:00
|
|
|
- name: Display build info
|
|
|
|
run: make pythoninfo
|
|
|
|
- name: Tests
|
|
|
|
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
|
2021-04-13 19:14:41 +00:00
|
|
|
|
|
|
|
build_ubuntu_ssltests:
|
2021-05-02 02:56:56 +00:00
|
|
|
name: 'Ubuntu SSL tests with OpenSSL'
|
2021-04-13 19:14:41 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
needs: check_source
|
|
|
|
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_ssl_tests == 'true'
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-08-22 18:28:57 +00:00
|
|
|
openssl_ver: [1.0.2u, 1.1.0l, 1.1.1v, 3.0.10, 3.1.2]
|
2021-04-13 19:14:41 +00:00
|
|
|
env:
|
|
|
|
OPENSSL_VER: ${{ matrix.openssl_ver }}
|
|
|
|
MULTISSL_DIR: ${{ github.workspace }}/multissl
|
|
|
|
OPENSSL_DIR: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}
|
|
|
|
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib
|
|
|
|
steps:
|
2023-09-05 20:39:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2021-04-13 19:14:41 +00:00
|
|
|
- name: Install Dependencies
|
|
|
|
run: sudo ./.github/workflows/posix-deps-apt.sh
|
|
|
|
- name: Configure OpenSSL env vars
|
|
|
|
run: |
|
|
|
|
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
|
|
|
|
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
|
|
|
|
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
|
|
|
|
- name: 'Restore OpenSSL build'
|
|
|
|
id: cache-openssl
|
2023-02-21 16:33:23 +00:00
|
|
|
uses: actions/cache@v3
|
2021-04-13 19:14:41 +00: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 $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
|
|
|
|
- name: Add ccache to PATH
|
|
|
|
run: |
|
|
|
|
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
|
|
|
|
- name: Configure ccache action
|
2023-02-21 16:33:23 +00:00
|
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
2021-04-13 19:14:41 +00:00
|
|
|
- name: Configure CPython
|
|
|
|
run: ./configure --with-pydebug --with-openssl=$OPENSSL_DIR
|
|
|
|
- name: Build CPython
|
|
|
|
run: make -j4
|
|
|
|
- name: Display build info
|
|
|
|
run: make pythoninfo
|
|
|
|
- name: SSL tests
|
|
|
|
run: ./python Lib/test/ssltests.py
|