Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ updates:
directory: "/"
schedule:
interval: "weekly"
cooldown:
default-days: 7
groups:
github-actions:
patterns:
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/uv-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

env:
COLUMNS: 200
# Many color libraries just need this variable to be set to any value.
Expand All @@ -21,10 +24,10 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: pre-commit/action@v3.0.1
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

copier-template-tester:
name: copier-template-tester (uv ${{ matrix.uv-version }})
Expand All @@ -34,21 +37,21 @@ jobs:
matrix:
uv-version: ["0.7.3", "latest"]
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@v7
- uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
with:
version: ${{ matrix.uv-version }}
- name: Use correct Python version in older uv version
if: ${{ matrix.uv-version == '0.7.3' }}
run: sed -i 's/14/13/g' ctt.toml copier.yml .python-version
- name: Configure Git
run: |
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
git config --global user.email "template-tester@example.com"
git config --global user.name "template-tester"
- name: Cache pre-commit
uses: actions/cache@v5
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml', 'project_name/.pre-commit-config.yaml.jinja') }}
Expand Down
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ repos:
rev: v1.7.12
hooks:
- id: actionlint
- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v1.23.1
hooks:
- id: zizmor

# shell scripts
- repo: https://github.com/shellcheck-py/shellcheck-py
Expand Down
2 changes: 2 additions & 0 deletions project_name/.github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ updates:
directory: /
schedule:
interval: weekly
cooldown:
default-days: 7
groups:
github-actions:
patterns: ['*']
44 changes: 22 additions & 22 deletions project_name/.github/workflows/ci.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -24,45 +24,45 @@ jobs:
format-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
{%- if format_tool == "black" %}
- uses: psf/black@stable
- uses: psf/black@35ea67920b7f6ac8e09be1c47278752b1e827f76 # stable
with:
jupyter: {{ "true" if contains_jupyter_files else "false" }}
use_pyproject: true
{%- elif format_tool == "ruff" %}
- uses: astral-sh/ruff-action@v3
- uses: astral-sh/ruff-action@146cd51f235777a9bc491eead18e0d5a4b05406a # v3
with:
args: format --check
{%- endif %}

ruff-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: astral-sh/ruff-action@v3
- uses: astral-sh/ruff-action@146cd51f235777a9bc491eead18e0d5a4b05406a # v3

pre-commit:
env:
COLUMNS: 120
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: pre-commit/action@v3.0.1
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@v7
- uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
- name: Install packages
run: >-
uv sync
Expand All @@ -80,10 +80,10 @@ jobs:
dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@v7
- uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
- name: Install packages
run: >-
uv sync
Expand Down Expand Up @@ -127,10 +127,10 @@ jobs:
runs-on: ${{ matrix.os }}
name: test-${{ matrix.python-version }}-${{ matrix.resolution }}-${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@v7
- uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
with:
python-version: ${{ matrix.python-version }}
cache-suffix: ${{ matrix.resolution }}
Expand Down Expand Up @@ -160,14 +160,14 @@ jobs:
--junitxml=junit.xml
- name: Upload test results to Codecov
if: ${{ !cancelled() && steps.run_tests.conclusion != 'skipped' }}
uses: codecov/codecov-action@v6
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }} # zizmor: ignore[secrets-outside-env]
report_type: test_results
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v6
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }} # zizmor: ignore[secrets-outside-env]
{%- endraw %}


Expand Down Expand Up @@ -195,10 +195,10 @@ jobs:
runs-on: ${{ matrix.os }}
name: test-${{ matrix.python-version }}-${{ matrix.resolution }}-${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@v7
- uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
with:
python-version: ${{ matrix.python-version }}
cache-suffix: ${{ matrix.resolution }}
Expand Down Expand Up @@ -233,10 +233,10 @@ jobs:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@v7
- uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
- name: Install packages
run: >-
uv sync
Expand Down Expand Up @@ -274,6 +274,6 @@ jobs:
- pylint
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@release/v1
- uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # release/v1
with:
jobs: {{ "${{ toJSON(needs) }}" }}
6 changes: 3 additions & 3 deletions project_name/.github/workflows/deps-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
pull-requests: write

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@v7
- uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
- name: Sync dependencies
run: uv sync
- name: Update dependencies
Expand All @@ -32,7 +32,7 @@ jobs:
uv run just deps-list-outdated 2>&1 || true
echo 'EOF' >> "$GITHUB_OUTPUT"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "⬆️ Update project dependencies"
Expand Down
19 changes: 11 additions & 8 deletions project_name/.github/workflows/weekly-ci.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:

permissions:
contents: read
issues: write

env:
# Many color libraries just need this variable to be set to any value.
Expand All @@ -19,11 +18,13 @@ jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
issues: write
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@v7
- uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
with:
python-version: '3.{{ python_max }}'
enable-cache: false
Expand All @@ -42,7 +43,7 @@ jobs:
run: uv run --no-sync pytest
- name: Create failure issue
if: failure()
uses: actions/github-script@v8
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
script: |
// Check for existing test failure issues
Expand Down Expand Up @@ -92,11 +93,13 @@ jobs:
pip-audit:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
issues: write
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@v7
- uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
- name: Export packages
run: >-
uv export
Expand All @@ -106,13 +109,13 @@ jobs:
-o requirements.txt
--no-emit-local
--locked
- uses: pypa/gh-action-pip-audit@v1.1.0
- uses: pypa/gh-action-pip-audit@1220774d901786e6f652ae159f7b6bc8fea6d266 # v1.1.0
with:
inputs: requirements.txt
require-hashes: true
- name: Create failure issue
if: failure()
uses: actions/github-script@v8
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
script: |
// Check for existing audit failure issues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
needs: ci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: hynek/build-and-inspect-python-package@v2
- uses: hynek/build-and-inspect-python-package@e6f4945c542cb46284a23bdb29121f4593636894 # v2

publish-to-testpypi:
if: github.event_name == 'push'
Expand All @@ -48,12 +48,12 @@ jobs:
id-token: write
steps:
- name: Download package distributions
uses: actions/download-artifact@v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: Packages
path: dist/
- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1
with:
repository-url: https://test.pypi.org/legacy/

Expand All @@ -70,9 +70,9 @@ jobs:
id-token: write
steps:
- name: Download package distributions
uses: actions/download-artifact@v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: Packages
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1
4 changes: 4 additions & 0 deletions project_name/.pre-commit-config.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ repos:
rev: <placeholder_until_update_deps>
hooks:
- id: actionlint
- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: <placeholder_until_update_deps>
hooks:
- id: zizmor

# Shell scripts
- repo: https://github.com/shellcheck-py/shellcheck-py
Expand Down
Loading