Restore Python 3.10 support #210
Workflow file for this run
This file contains hidden or 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: [main] | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.12" | |
| - uses: pre-commit/[email protected] | |
| tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| sphinx-version: ["6", "7", "8"] | |
| exclude: | |
| # Python 3.13 with Sphinx 6 generates many deprecation warnings | |
| # from Sphinx's use of deprecated datetime methods. Unlikely combination. | |
| - python-version: "3.13" | |
| sphinx-version: "6" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run : | | |
| python -m pip install --upgrade pip | |
| pip install -e.[testing] | |
| pip install "sphinx>=${{ matrix.sphinx-version }},<${{ matrix.sphinx-version == '6' && '7' || matrix.sphinx-version == '7' && '8' || '9' }}" | |
| - name: Run pytest | |
| run: | | |
| pytest --durations=10 --cov=sphinx_exercise --cov-report=xml --cov-report=term-missing | |
| - name: Create cov | |
| run: coverage xml | |
| - name: Upload to Codecov | |
| if: matrix.python-version == '3.12' && matrix.sphinx-version == '8' | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| name: sphinx-exercise-pytest-py3.12-sphinx8 | |
| token: "${{ secrets.CODECOV_TOKEN }}" | |
| flags: pytests | |
| file: ./coverage.xml | |
| fail_ci_if_error: true | |
| docs: | |
| name: Documentation build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.10" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e .[rtd] | |
| - name: Build docs | |
| run: | | |
| cd docs | |
| make clean | |
| make html | |
| publish: | |
| name: Publish to PyPi | |
| needs: [pre-commit, tests, docs] | |
| if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.10" | |
| - name: Build package | |
| run: | | |
| pip install wheel build | |
| python -m build | |
| - name: Publish | |
| uses: pypa/[email protected] | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_KEY }} |