Standardize development dependency location + use uv more #707
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, test, & publish | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| - major-release | |
| release: | |
| types: | |
| - published | |
| permissions: read-all | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| CACHE_GLOBS: | | |
| **/pyproject.toml | |
| **/requirements*.txt | |
| **/setup.py | |
| **/uv.lock | |
| steps: | |
| - uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b | |
| with: | |
| disable-sudo: true | |
| egress-policy: audit | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 | |
| with: | |
| python-version: 3.13 | |
| activate-environment: true | |
| cache-dependency-glob: ${{ env.CACHE_GLOBS }} | |
| - run: >- | |
| uv sync | |
| --upgrade | |
| --all-extras | |
| - run: >- | |
| uv build | |
| --sdist | |
| - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f | |
| with: | |
| name: parsons-dist | |
| path: dist/ | |
| test: | |
| needs: build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: | |
| - '3.10' | |
| - '3.11' | |
| - '3.12' | |
| - '3.13' | |
| os: | |
| - ubuntu-latest | |
| - windows-latest | |
| - macos-latest | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b | |
| with: | |
| disable-sudo: true | |
| egress-policy: audit | |
| - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 | |
| with: | |
| name: parsons-dist | |
| path: dist | |
| - shell: bash | |
| run: | | |
| file=$(find ./dist -name 'parsons-*.tar.gz' | head -1) | |
| # Extract to a temp directory first | |
| mkdir -p temp_extract | |
| tar -xzf "$file" -C temp_extract | |
| # Find and move requirements files to root | |
| find temp_extract -name 'requirements.txt' -exec cp {} . \; 2>/dev/null || true | |
| # Clean up | |
| rm -rf temp_extract | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - shell: bash | |
| run: | | |
| file=$(find ./dist -name 'parsons-*.tar.gz' | head -1) | |
| pip install "$file" | |
| publish: | |
| if: github.repository_owner == 'move-coop' && github.event_name == 'release' && github.event.action == 'published' | |
| needs: test | |
| runs-on: ubuntu-latest | |
| environment: release | |
| permissions: | |
| id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
| steps: | |
| - uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b | |
| with: | |
| disable-sudo: true | |
| egress-policy: audit | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 | |
| with: | |
| name: parsons-dist | |
| path: dist | |
| - uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e | |
| with: | |
| verify-metadata: true | |
| skip-existing: true | |
| packages-dir: dist | |
| verbose: true |