build(pyproject): migrate to uv #334
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: test | |
| on: [push, pull_request] | |
| permissions: | |
| contents: read | |
| jobs: | |
| unit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install dependencies | |
| run: uv sync --extra test | |
| - name: Run tests and collect coverage | |
| run: | | |
| uv run coverage run -m pytest | |
| uv run coverage report | |
| uv run coverage xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| integration: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| command: | |
| - python-cli-template | |
| - python-cli-template --name test | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install tool | |
| run: uv tool install . | |
| - name: Run command | |
| run: ${{ matrix.command }} | |
| - name: Get version | |
| run: | | |
| VERSION=$(grep version src/python_cli_template/__init__.py | cut -d'"' -f 2) | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| - name: Check version | |
| run: | | |
| set -e | |
| [[ $(python-cli-template --version) == "$VERSION" ]] | |
| [[ $(python-cli-template -v) == "$VERSION" ]] |