feat: migrate to Copier template #60
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate-template: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7 | |
| with: | |
| version: "0.11.3" | |
| python-version: "3.12" | |
| - name: Render template | |
| run: | | |
| uvx copier copy . /tmp/rendered-project \ | |
| --defaults \ | |
| --overwrite \ | |
| --skip-tasks \ | |
| --data project_name=my-test-project \ | |
| --data description="A test project" \ | |
| --data author_name="Test Author" \ | |
| --data author_email="test@example.com" \ | |
| --data github_user=test-user | |
| - name: Install rendered project deps | |
| working-directory: /tmp/rendered-project | |
| run: uv sync --dev | |
| - name: Lint | |
| working-directory: /tmp/rendered-project | |
| run: | | |
| uv run ruff check src/ tests/ | |
| uv run ruff format --check src/ tests/ | |
| - name: Type check | |
| working-directory: /tmp/rendered-project | |
| run: uv run mypy src/ | |
| - name: Test | |
| working-directory: /tmp/rendered-project | |
| run: uv run pytest -v --cov=src --cov-report=xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6 | |
| with: | |
| files: /tmp/rendered-project/coverage.xml | |
| audit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7 | |
| with: | |
| version: "0.11.3" | |
| - run: uv sync --dev | |
| - run: uv run pip-audit |