Skip to content

Scheduled pre-release tests #115

Scheduled pre-release tests

Scheduled pre-release tests #115

Workflow file for this run

name: Scheduled pre-release tests
on:
schedule:
# Run this workflow twice a week
# ref: https://crontab.guru/#0_5_*_*_1,4
- cron: "0 5 * * 1,4"
workflow_dispatch:
jobs:
prerelease:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "pyproject.toml"
- name: Install (prerelease) dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install --upgrade --pre -e .[doc,test]
- name: Build docs to store
run: |
sphinx-build -b html docs/ docs/_build/html --keep-going -w warnings.txt
- name: Check that there are no unexpected Sphinx warnings
if: matrix.python-version == '3.10'
run: python tests/utils/check_warnings.py
- name: Run the tests
run: |
pytest --color=yes
echo "PYTEST_ERRORS=$?" >> $GITHUB_ENV
# If either the docs build or the tests resulted in an error, create an issue to note it
- name: Create an issue if failure
uses: JasonEtco/create-an-issue@v2
if: ${{ env.SPHINX_BUILD_UNEXPECTED_WARNINGS || !env.PYTEST_ERRORS }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/prerelease-template.md