Merge pull request #28 from akdor1154/gha #25
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: CI | |
| on: | |
| push: | |
| branches: ["*"] | |
| tags: ["v*"] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| env: | |
| UV_PYTHON: "${{ matrix.python-version }}" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| # needs double-specifying to affect cache | |
| python-version: "${{ matrix.python-version }}" | |
| - run: uv sync | |
| - run: make ruff | |
| - run: make pyright | |
| - run: make pytest | |
| docs: | |
| runs-on: ubuntu-latest | |
| env: | |
| UV_PYTHON: "3.13" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| # needs double-specifying to affect cache | |
| python-version: "3.13" | |
| - run: uv sync | |
| - run: make docs | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs | |
| path: docs/_build/html/ | |
| - run: make doctest | |
| publish: | |
| runs-on: ubuntu-latest | |
| needs: [test, docs] | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| environment: pypi | |
| permissions: | |
| id-token: write | |
| env: | |
| UV_PYTHON: "3.13" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| # needs double-specifying to affect cache | |
| python-version: "3.13" | |
| - run: uv build | |
| - uses: pypa/gh-action-pypi-publish@release/v1 |