Skip to content

Commit 9219b59

Browse files
committed
github workflow for testing the template creation
1 parent 6545cc3 commit 9219b59

File tree

4 files changed

+365
-6
lines changed

4 files changed

+365
-6
lines changed

.github/workflows/test_template.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,33 @@ on: [push]
55
jobs:
66

77
test_template:
8-
runs-on: [ubuntu-latest, windows-latest, macos-latest]
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
vcs: [hg, git]
912
steps:
1013

14+
- name: Check out repository
15+
uses: actions/checkout@v5
16+
1117
- name: Set up python
12-
uses: actions/setup-python@v4
18+
uses: actions/setup-python@v6
1319
with:
14-
python-version: '3.12'
20+
python-version-file: 'pyproject.toml'
1521

16-
- name: Check out repository
17-
uses: actions/checkout@v3
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v6
24+
with:
25+
version: "0.9.8"
26+
enable-cache: true
27+
28+
- name: Install dependencies
29+
run: uv sync --locked --no-install-project
1830

1931
- name: Test
20-
run: make test
32+
run: uv run make test
33+
env:
34+
VCS: ${{ matrix.vcs }}
35+
36+
- name: Minimize uv cache
37+
run: uv cache prune --ci

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
TARGET_NAME := "perfect_python_project"
22
PYTHON_VERSION := $(shell python --version | sed -r -e 's/Python //' -e 's/\.[0-9]+$$//')
3+
VCS ?= hg
34

45
test:
56
@echo Target: /tmp/$(TARGET_NAME)
@@ -13,6 +14,7 @@ test:
1314
project_slug: \"$(TARGET_NAME)\"\n\
1415
python_version: \"$(PYTHON_VERSION)\"\n\
1516
line_length: 100\n\
17+
version_control: \"$(VCS)\"\n\
1618
" > /tmp/$(TARGET_NAME).yml
1719

1820
cookiecutter --no-input --config-file /tmp/$(TARGET_NAME).yml \

pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[project]
2+
name = "perfect-python-project"
3+
version = "0.1.0"
4+
description = "This project template creates the basic structure for a Python project."
5+
authors = [
6+
{name="André Miras", email="andre.miras@example.com"},
7+
]
8+
readme = "README.rst"
9+
requires-python = ">=3.14"
10+
dependencies = [
11+
"cookiecutter",
12+
"mercurial",
13+
]

0 commit comments

Comments
 (0)