1.0.0a1 #549
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: Build and Deploy | |
| on: | |
| push: | |
| pull_request: | |
| types: [assigned, labeled] | |
| release: | |
| types: [published] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [3.9, "3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.0.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| uv sync --all-extras | |
| - name: Run mypy check | |
| run: uv run mypy -p varname | |
| - name: Run flake8 | |
| run: uv run flake8 varname | |
| - name: Test with pytest | |
| run: uv run pytest tests/ --junitxml=junit/test-results-${{ matrix.python-version }}.xml | |
| - name: Upload pytest test results | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: pytest-results-${{ matrix.python-version }} | |
| path: junit/test-results-${{ matrix.python-version }}.xml | |
| # Use always() to always run this step to publish test results when there are test failures | |
| if: ${{ always() }} | |
| - name: Upload Coverage | |
| run: | | |
| export CODACY_PROJECT_TOKEN=${{ secrets.CODACY_PROJECT_TOKEN }} | |
| bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r .coverage.xml | |
| if: matrix.python-version == '3.12' && github.event_name != 'pull_request' | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' | |
| strategy: | |
| matrix: | |
| python-version: ["3.12"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.0.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Build and publish to PyPI | |
| run: | | |
| uv build | |
| uv publish --username ${{ secrets.PYPI_USER }} --password ${{ secrets.PYPI_PASSWORD }} | |
| if: success() |