Fix warnings about undefined python-version #136
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: tests | |
| on: [push, pull_request] | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| python: | |
| - '3.10' | |
| - '3.11' | |
| - '3.12' | |
| - '3.13' | |
| - pypy-3.10 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Install pymarkups and all optional dependencies | |
| run: | | |
| pip install --upgrade pip setuptools | |
| pip install .[markdown,restructuredtext,textile,asciidoc,highlighting] | |
| pip install codecov pymdown-extensions | |
| - name: Run tests | |
| run: coverage run -m unittest discover -s tests -v | |
| - name: Run the doctest | |
| run: python -m doctest README.rst -v | |
| - name: Upload reports to Codecov | |
| if: ${{ matrix.python == '3.13' }} | |
| run: codecov | |
| mypy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install mypy and type stubs | |
| run: python -m pip install mypy types-docutils types-PyYAML types-Markdown | |
| - name: Run mypy | |
| run: mypy --ignore-missing-imports --strict . | |
| ruff: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install ruff | |
| run: python -m pip install ruff | |
| - name: Run ruff check | |
| run: ruff check --select F,E,W,I,UP,A,COM --target-version py310 . | |
| - name: Run ruff format | |
| run: ruff format --diff . | |
| pypi-publish: | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
| needs: | |
| - test | |
| - mypy | |
| - ruff | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/Markups | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - run: pip install build | |
| - run: python -m build | |
| - if: success() | |
| uses: pypa/gh-action-pypi-publish@release/v1 |