From 88dcb90d4549ff5fd4b8d994301445efeeafc4fe Mon Sep 17 00:00:00 2001 From: Jan Vesely Date: Sun, 17 Jan 2021 23:06:37 -0500 Subject: [PATCH] github-actions: Add pypy3.8, pypy3.9, pypy3.10, and pypy3.11 jobs Restrict max pypy heap size to 3GB. Bump test timeout to 360 min. Signed-off-by: Jan Vesely --- .github/actions/install-pnl/action.yml | 15 ++++++++--- .github/workflows/pnl-ci.yml | 36 +++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/.github/actions/install-pnl/action.yml b/.github/actions/install-pnl/action.yml index 0cdaff772c..6c9317d378 100644 --- a/.github/actions/install-pnl/action.yml +++ b/.github/actions/install-pnl/action.yml @@ -25,7 +25,7 @@ runs: run: | case "$RUNNER_OS" in macOS*) brew install graphviz ;; - Linux*) sudo apt-get update && sudo apt-get install -y --no-install-recommends graphviz ;; + Linux*) sudo apt-get update && sudo apt-get install -y --no-install-recommends graphviz build-essential pkg-config gfortran llvm${LLVM_SUFFIX}-dev libfreetype6-dev libjpeg-dev libopenblas-dev zlib1g-dev ;; Windows*) choco install --no-progress -y graphviz --version=2.38.0.20190211 ;; *) echo "Unsupported OS"; exit 1 ;; esac @@ -44,14 +44,15 @@ runs: echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV echo "$PYTHON_LOC" >> $GITHUB_PATH - - name: Update pip and wheel + - name: Update pip, wheel, and cython shell: bash - run: python -m pip install --upgrade pip wheel + run: python -m pip install --upgrade pip wheel 'cython<3' - name: Drop pytorch on x86 shell: bash run: | - echo > env_constraints.txt + # grpcio fails to build with cython >= 3 + echo 'cython<3' > env_constraints.txt if [ $(python -c 'import struct; print(struct.calcsize("P") * 8)') == 32 ]; then sed -i /torch/d requirements.txt sed -i /modeci_mdf/d requirements.txt @@ -73,6 +74,9 @@ runs: echo "llvmlite < 0.42.0" >> env_constraints.txt # matplotlib >=3.8.0 doesn't provide win32 wheel echo "matplotlib < 3.8.0" >> env_constraints.txt + + # pywinpty needs extra libraries if built with cython available + pip uninstall cython -y fi - name: Install updated package @@ -109,6 +113,9 @@ runs: shell: bash run: | pip install ${{ steps.dist.outputs.wheel }}[${{ inputs.features }}] -c env_constraints.txt -c broken_trans_deps.txt + env: + LLVM_CONFIG: llvm-config${{ env.LLVM_SUFFIX }} + GRPC_PYTHON_BUILD_WITH_CYTHON: 1 - name: Cleanup old wheels shell: bash diff --git a/.github/workflows/pnl-ci.yml b/.github/workflows/pnl-ci.yml index 7576dba7d2..f486143798 100644 --- a/.github/workflows/pnl-ci.yml +++ b/.github/workflows/pnl-ci.yml @@ -13,6 +13,10 @@ on: - 'v**' pull_request: +env: +# github linux/windows runners have 7GB RAM + PYPY_GC_MAX: 3GB + # run only the latest instance of this workflow job for the current branch/PR # cancel older runs # fall back to run id if not available (run id is unique -> no cancellations) @@ -77,6 +81,34 @@ jobs: os: macos version-restrict: 'min' + # add pypy-3.8 + - python-version: 'pypy-3.8' + python-architecture: 'x64' + os: ubuntu + extra-args: '--forked' + llvm-suffix: '-15' + + # add pypy-3.9 + - python-version: 'pypy-3.9' + python-architecture: 'x64' + os: ubuntu + extra-args: '--forked' + llvm-suffix: '-15' + + # add pypy-3.10 + - python-version: 'pypy-3.10' + python-architecture: 'x64' + os: ubuntu + extra-args: '--forked' + llvm-suffix: '-15' + + # add pypy-3.11 + - python-version: 'pypy-3.11' + python-architecture: 'x64' + os: ubuntu + extra-args: '--forked' + llvm-suffix: '-15' + exclude: # 3.8/x64 python is broken on aarch64 macos runners # https://github.com/actions/setup-python/issues/960 @@ -134,6 +166,8 @@ jobs: id: install with: features: 'dev' + env: + LLVM_SUFFIX: ${{ matrix.llvm-suffix }} - name: Lint with flake8 shell: bash @@ -159,7 +193,7 @@ jobs: esac - name: Test with pytest - timeout-minutes: 180 + timeout-minutes: 360 run: pytest --junit-xml=tests_out.xml --verbosity=0 -n logical --capture=sys -o console_output_style=count ${{ matrix.extra-args }} - name: Upload test results