build(deps): bump mypy from 1.20.0 to 1.20.1 (#15) #45
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 | |
| 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 with coverage | |
| run: | | |
| uv run coverage run -m pytest | |
| uv run coverage report | |
| uv run coverage xml | |
| package: | |
| runs-on: ubuntu-latest | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| strategy: | |
| matrix: | |
| install: [external, local] | |
| steps: | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Create project | |
| run: uv init | |
| - name: Get latest release | |
| id: release | |
| run: | | |
| TAG=$(gh release view --repo ${{ github.repository }} --json tagName -q .tagName) | |
| echo "tag=$TAG" >> $GITHUB_OUTPUT | |
| - name: Install external package | |
| if: matrix.install == 'external' | |
| run: | | |
| URL=$(gh release view ${{ steps.release.outputs.tag }} --repo ${{ github.repository }} --json assets -q '.assets[] | select(.name | endswith(".whl")) | .url') | |
| uv add $URL | |
| - name: Install local package | |
| if: matrix.install == 'local' | |
| run: | | |
| gh release download ${{ steps.release.outputs.tag }} -R ${{ github.repository }} -p '*.whl' -D ./vendor/ --clobber | |
| uv add ./vendor/*.whl | |
| - name: Update script | |
| run: | | |
| cat <<EOF > main.py | |
| from python_package import hello | |
| print(hello()) | |
| EOF | |
| - name: Run script | |
| run: uv run main.py |