use pep 735 dependency groups instead of dev/test extras, use setup-uv #92
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 copier | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: ${{ matrix.platform }} py${{ matrix.python-version }} | |
| runs-on: ${{ matrix.platform }} | |
| env: | |
| UV_PYTHON: ${{ matrix.python-version }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: [ubuntu-latest, windows-latest, macos-latest] | |
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v6 | |
| - run: uv run pytest tests -v --color=yes | |
| generate_and_dispatch: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: pipx run copier copy . generated --vcs-ref=HEAD --defaults | |
| - name: prepare throw-away branch | |
| run: | | |
| git config user.name "GitHub Actions" | |
| git config user.email "actions@github.com" | |
| BR=generated-pr-${{ github.event.pull_request.number }} | |
| git checkout -b "$BR" | |
| cp -R generated/* . | |
| git add . | |
| git commit -m "🤖 Generated project for PR #${{ github.event.pull_request.number }}" | |
| git push --set-upstream origin "$BR" | |
| # pushes up `generated-pr-123` | |
| - name: trigger generated CI | |
| uses: actions/github-script@v6 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const pr = context.payload.pull_request.number | |
| const branch = `generated-pr-${pr}` | |
| await github.rest.actions.createWorkflowDispatch({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| workflow_id: 'ci.yml', // the filename inside .github/workflows | |
| ref: branch | |
| }) |