⬆️ Opt fully into uv #389
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: "Tests" | |
| on: | |
| push: | |
| tags: | |
| - v** | |
| branches-ignore: | |
| - "dependabot/**" | |
| - "sourcery/**" | |
| - "create-pr-action/pre-commit-config-update*" | |
| pull_request: | |
| jobs: | |
| pre-commit: | |
| name: Pre-commit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| - name: Run pre-commit | |
| uses: pre-commit/action@v3.0.1 | |
| docs: | |
| name: Build Docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install asdf package manager | |
| uses: asdf-vm/actions/setup@v4 | |
| - name: Install pandoc | |
| run: | | |
| asdf plugin add pandoc | |
| asdf install pandoc latest | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Install just | |
| run: | | |
| uv tool install rust-just | |
| - name: Install dependencies | |
| run: | | |
| uv sync --group docs | |
| - name: Show installed dependencies | |
| run: | | |
| uv tree | |
| - name: Build docs | |
| run: just docs/html | |
| docs-link: | |
| name: Check Doc Links | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install asdf package manager | |
| uses: asdf-vm/actions/setup@v4 | |
| - name: Install pandoc | |
| run: | | |
| asdf plugin add pandoc | |
| asdf install pandoc latest | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Install just | |
| run: | | |
| uv tool install rust-just | |
| - name: Install dependencies | |
| run: | | |
| uv sync --group docs | |
| - name: Show installed dependencies | |
| run: | | |
| uv tree | |
| - name: Check links in docs | |
| run: just docs/linkcheck | |
| test: | |
| name: Test pyglotaran stable | |
| runs-on: ${{ matrix.os }} | |
| needs: [pre-commit, docs] | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macOS-latest] | |
| python-version: ["3.10", "3.11"] | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Install dependencies | |
| run: | | |
| uv sync --frozen --group test | |
| - name: Run tests | |
| run: uv run pytest --nbval --cov=pyglotaran_extras --cov-report term --cov-report xml --cov-config pyproject.toml tests | |
| - name: Codecov Upload | |
| continue-on-error: true | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage.xml | |
| name: ${{ matrix.os }}-py${{ matrix.python-version }} | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| test-pyglotaran-dev: | |
| name: Test pyglotaran dev | |
| runs-on: ubuntu-latest | |
| needs: [pre-commit, docs] | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@v6 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Install dependencies | |
| run: | | |
| uv sync --frozen --group test | |
| uv add git+https://github.com/glotaran/pyglotaran | |
| - name: Show installed dependencies | |
| run: uv tree | |
| - name: Run tests | |
| run: uv run pytest --nbval --cov=pyglotaran_extras --cov-report term --cov-report xml --cov-config pyproject.toml tests | |
| - name: Codecov Upload | |
| continue-on-error: true | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage.xml | |
| name: test-pyglotaran-dev | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| test-min-versions: | |
| name: Test dependency min versions | |
| runs-on: ubuntu-latest | |
| needs: [pre-commit, docs] | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@v6 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Install dependencies | |
| run: | | |
| uv sync --group test --resolution lowest | |
| - name: Show installed dependencies | |
| run: uv tree | |
| - name: Run tests | |
| run: uv run pytest --nbval --cov=./ --cov-report term --cov-report xml --cov-config pyproject.toml tests | |
| - name: Codecov Upload | |
| continue-on-error: true | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage.xml | |
| name: test-min-versions | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| deploy: | |
| name: Deploy to PyPi | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
| needs: [test, test-pyglotaran-dev, test-min-versions] | |
| permissions: | |
| id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Build dist | |
| run: uv build | |
| - name: Publish package | |
| uses: pypa/gh-action-pypi-publish@v1.13.0 | |
| with: | |
| print-hash: true | |
| attestations: true |