Skip to content

Speed up liveness check on matplotlib>=3.7. #108

Speed up liveness check on matplotlib>=3.7.

Speed up liveness check on matplotlib>=3.7. #108

Workflow file for this run

name: build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
flag: [""]
include:
- python-version: "3.7"
flag: "oldest"
- python-version: "3.12"
flag: "pre"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: |
case '${{ matrix.flag }}' in
oldest)
NUMPY_VERSION='==1.14.*'
MATPLOTLIB_VERSION='==3.1.0'
;;
pre)
PIP_INSTALL_PRE=true
;;
esac &&
pip install --upgrade pip setuptools wheel pytest pytest-cov coverage[toml] &&
# Force install of numpy before matplotlib.
pip install --upgrade --upgrade-strategy=only-if-needed --only-binary=:all: numpy"$NUMPY_VERSION" &&
pip install --upgrade --upgrade-strategy=only-if-needed matplotlib"$MATPLOTLIB_VERSION" &&
pip install . &&
pip list
- name: Test
run: |
pyver="$(python -c 'import sys; print("{0.major}.{0.minor}".format(sys.version_info))')" &&
COVERAGE_FILE=".coverage.$pyver" python -mpytest --cov --cov-branch --cov-report=xml
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}-${{ matrix.flag }}
path: .coverage.*
coverage:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Download
uses: actions/download-artifact@v4
with:
pattern: coverage-*
merge-multiple: true
- name: Run
run: |
shopt -s globstar &&
python -mpip install --upgrade coverage &&
python -mcoverage combine .coverage.* && # Unifies paths across envs.
python -mcoverage annotate &&
( grep -HnTC2 '^!' **/*,cover || true ) &&
python -mcoverage report --show-missing