Upgrade setup-uv action to v7 #373
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: Run tests and lint, maybe deploy | |
| on: [push, pull_request] | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: | |
| - '3.8' | |
| - '3.9' | |
| - '3.10' | |
| - '3.11' | |
| - '3.12' | |
| - '3.13' | |
| - '3.14' | |
| name: Run tests on Python ${{ matrix.python-version }} (${{ matrix.os }}) | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| pip install pytest numpy | |
| - name: Run pytest | |
| run: pytest | |
| lint: | |
| runs-on: ubuntu-latest | |
| name: Lint with flake8 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install dependencies | |
| run: uv sync --frozen --group dev | |
| - name: Run flake8 | |
| run: uv run flake8 . | |
| spellcheck: | |
| runs-on: ubuntu-latest | |
| name: Spellcheck with codespell | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install dependencies | |
| run: uv sync --frozen --group dev | |
| - name: Run codespell | |
| run: uv run codespell | |
| type-check: | |
| runs-on: ubuntu-latest | |
| name: Check with mypy | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install dependencies | |
| run: uv sync --frozen --group dev | |
| - name: Run mypy | |
| run: uv run mypy mockito | |
| deploy: | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
| needs: [test, lint, type-check] | |
| runs-on: ubuntu-latest | |
| name: Deploy to pypi | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build | |
| - name: Build package | |
| run: python -m build | |
| - name: Publish package | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| verbose: true |