1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
name: 'Tests'
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on: # yamllint disable-line rule:truthy
push:
branches: ['master']
pull_request:
branches: ['master']
permissions:
contents: read
jobs:
pytest:
name: '${{ matrix.os }} / ${{ matrix.python }} / ${{ matrix.distrib }} / ${{ matrix.sphinx_version }}'
timeout-minutes: 30
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
env:
PYTHON_VERSION: '${{ matrix.python }}'
SPHINX_VERSION: '${{ matrix.sphinx_version }}'
DISTRIB: '${{ matrix.distrib }}'
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest # newest possible
python: '3.12'
sphinx_version: dev
distrib: pip
locale: C
- os: ubuntu-latest
python: '3.11'
sphinx_version: '5'
distrib: pip
- os: ubuntu-latest
python: '3.11'
sphinx_version: '6'
distrib: mamba
- os: ubuntu-latest
python: '3.8'
sphinx_version: '7'
distrib: minimal
- os: macos-latest
python: '3.11'
sphinx_version: 'default'
distrib: mamba # only use mamba on macOS to avoid Python shell issues
- os: windows-latest
python: '3.11'
sphinx_version: 'default'
distrib: pip
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Xvfb/OpenGL
- uses: pyvista/setup-headless-display-action@main
with:
qt: true
pyvista: false
# Python (if pip)
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
if: matrix.distrib != 'mamba'
# Python (if conda)
- uses: mamba-org/setup-micromamba@v2
with:
environment-name: test
init-shell: bash
create-args: >-
python=${{ env.PYTHON_VERSION }} pip numpy setuptools matplotlib pillow
pytest pytest-cov coverage seaborn statsmodels plotly joblib wheel libiconv
pygraphviz memory_profiler ipython pypandoc lxml conda-libmamba-solver mamba
ffmpeg intersphinx-registry
if: matrix.distrib == 'mamba'
# Make sure that things work even if the locale is set to C (which
# effectively means ASCII). Some of the input rst files have unicode
# characters and we need to deal with this gracefully.
- name: Set env vars
shell: bash -e {0}
run: |
echo "LC_ALL=C" >> $GITHUB_ENV
echo "LANG=C" >> $GITHUB_ENV
echo "LC_CTYPE=C" >> $GITHUB_ENV
if: matrix.locale == 'C'
- run: .github/install.sh
- run: pytest sphinx_gallery -v --tb=short
- name: Remove incompatible doc config entries
run: |
if [[ "$(uname)" == "Darwin" ]]; then
CMD="sed -i ''"
else
CMD="sed -i"
fi
$CMD "/show_memory/d" doc/conf.py
$CMD "/compress_images/d" doc/conf.py
if: ${{ !startsWith(matrix.os, 'ubuntu') }}
# pydata-sphinx-theme is not compatible with Sphinx 4
- run: make -C doc SPHINXOPTS= html-noplot
if: matrix.distrib != 'minimal' && matrix.sphinx_version != '4'
- run: make -C doc SPHINXOPTS= html -j 2
if: matrix.distrib != 'minimal' && matrix.sphinx_version != '4'
- uses: codecov/codecov-action@v5
|