Merge pull request #2154 from executablebooks/agoose77/fix-latexcodec… #2830
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: continuous-integration | |
on: | |
push: | |
branches: [master] | |
tags: | |
- 'v*' | |
pull_request: | |
workflow_call: | |
env: | |
# Force colors for logs | |
PY_COLORS: 1 | |
FORCE_COLOR: True | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- uses: pre-commit/action@v3.0.0 | |
# for speed, we run a test matrix against only the tests that do not require TeX, | |
# then test-with-cov for all tests, for a single environment | |
test-with-cov: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.9] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel | |
pip install -e .[testing] | |
- name: Install Headless Chrome dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -yq $(cat .github/workflows/pyppeteer_reqs.txt) | |
- name: Install latex dependencies | |
run: | | |
sudo apt-get -qq update | |
sudo apt-get install -y \ | |
texlive \ | |
texlive-xetex \ | |
texlive-latex-extra \ | |
texlive-fonts-extra \ | |
fonts-freefont-otf \ | |
latexmk \ | |
xindy | |
- name: Run pytest | |
run: | | |
pytest --durations=10 --cov=jupyter_book --cov-report=xml --cov-report=term-missing | |
coverage xml | |
# for some reason the tests/conftest.py::check_nbs fixture breaks pytest-cov's cov-report outputting | |
# this is why we run `coverage xml` afterwards (required by codecov) | |
- name: Upload to Codecov | |
if: github.repository == 'executablebooks/jupyter-book' | |
uses: codecov/codecov-action@v3.1.4 | |
with: | |
name: ebp-jupyter-book-pytests-py3.9 | |
flags: pytests | |
file: ./coverage.xml | |
fail_ci_if_error: true | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
# We support sphinx>=5,<8, but docutils compatibility of sphinxcontrib-bibtex requires | |
# that we do not test sphinx==6. | |
sphinx: ["==5.*", "==7.*"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel | |
pip install -e .[testing] "sphinx${{ matrix.sphinx }}" | |
- name: Install Headless Chrome dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -yq $(cat .github/workflows/pyppeteer_reqs.txt) | |
- name: Run pytest | |
run: pytest --durations=10 -m 'not requires_tex' |