Migrate project to uv #76
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 | |
| on: | |
| - push | |
| - pull_request | |
| jobs: | |
| test: | |
| if: github.repository == 'adobe/pydc-control' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: | |
| - '3.9' | |
| - '3.10' | |
| - '3.11' | |
| - '3.12' | |
| - '3.13' | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Docker Compose | |
| uses: docker/setup-compose-action@v1 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --locked | |
| - name: Run pre-commit checks | |
| run: uv run pre-commit run --all-files | |
| - name: Test with pytest | |
| run: uv run pytest --junitxml=test-reports/test-results.xml | |
| - name: Publish test results | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| if: always() | |
| with: | |
| files: test-reports/test-results.xml | |
| check_name: "Test Results ${{ matrix.python-version }}" | |
| publish: | |
| if: github.repository == 'adobe/pydc-control' | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| # Fetch all history in order to get the commit count for the version in setup.py | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: 3.9 | |
| - name: Set version | |
| run: uv version --no-sync "$(uv version --short).$(git rev-list --count HEAD)" | |
| - name: Build | |
| run: uv build | |
| - name: Check upload | |
| run: uv run --with twine twine check dist/* | |
| - name: Publish to PyPi | |
| # Only publish if this was a push | |
| if: github.event_name == 'push' | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.ADOBE_BOT_PYPI_TOKEN }} |