Skip to content

Commit c501ae0

Browse files
ci: add cross-platform scaffold smoke (#201)
* ci: add cross-platform scaffold smoke Co-authored-by: Cursor <cursoragent@cursor.com> * fix(ci): use full template URLs and options-before-path for uvx smoke Published 0.1.0 does not resolve catalog slugs; Typer also misparses options when the project path comes first. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 6aa6dff commit c501ae0

2 files changed

Lines changed: 104 additions & 1 deletion

File tree

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Cross-platform scaffold smoke
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: scaffold-cross-platform-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
env:
18+
# Full registry URLs: published PyPI 0.1.0 does not resolve catalog slugs.
19+
# After create-awesome-python-app>=0.2.0 ships resolve_catalog_spec, slugs also work.
20+
CPA_TEMPLATE_FASTAPI: https://github.com/Create-Python-App/cpa-templates?subdir=templates/fastapi-starter
21+
CPA_ADDON_DOCKER: https://github.com/Create-Python-App/cpa-templates?subdir=extensions/python-docker
22+
23+
jobs:
24+
scaffold:
25+
name: ${{ matrix.os }} / fastapi-starter
26+
runs-on: ${{ matrix.os }}
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
os: [ubuntu-latest, macos-latest, windows-latest]
31+
steps:
32+
- uses: astral-sh/setup-uv@v7
33+
- uses: actions/setup-python@v6
34+
with:
35+
python-version: "3.12"
36+
37+
- name: Scaffold FastAPI starter from PyPI CLI
38+
env:
39+
TARGET: ${{ runner.temp }}/cpa-fastapi-starter
40+
shell: bash
41+
run: |
42+
set -euo pipefail
43+
# Options before project_directory — Typer treats a leading path as the
44+
# positional arg; trailing options after a bare path can be misparsed.
45+
uvx create-awesome-python-app@latest \
46+
--template "$CPA_TEMPLATE_FASTAPI" \
47+
--no-interactive \
48+
--no-install \
49+
--force \
50+
"$TARGET"
51+
52+
- name: Verify scaffolded project
53+
env:
54+
TARGET: ${{ runner.temp }}/cpa-fastapi-starter
55+
shell: bash
56+
run: |
57+
set -euo pipefail
58+
python - <<'PY'
59+
import os
60+
from pathlib import Path
61+
62+
target = Path(os.environ["TARGET"])
63+
required = [
64+
target / "pyproject.toml",
65+
target / "app" / "main.py",
66+
target / "README.md",
67+
]
68+
missing = [str(path) for path in required if not path.exists()]
69+
if missing:
70+
raise SystemExit(f"Missing scaffolded files: {missing}")
71+
print(f"Verified scaffold at {target}")
72+
PY
73+
74+
addon-smoke:
75+
name: ubuntu-latest / fastapi-starter + python-docker
76+
runs-on: ubuntu-latest
77+
steps:
78+
- uses: astral-sh/setup-uv@v7
79+
- uses: actions/setup-python@v6
80+
with:
81+
python-version: "3.12"
82+
83+
- name: Scaffold with one extension from PyPI CLI
84+
env:
85+
TARGET: ${{ runner.temp }}/cpa-fastapi-docker
86+
run: |
87+
set -euo pipefail
88+
uvx create-awesome-python-app@latest \
89+
--template "$CPA_TEMPLATE_FASTAPI" \
90+
--addons "$CPA_ADDON_DOCKER" \
91+
--no-interactive \
92+
--no-install \
93+
--force \
94+
"$TARGET"
95+
96+
- name: Verify extension files
97+
env:
98+
TARGET: ${{ runner.temp }}/cpa-fastapi-docker
99+
run: |
100+
set -euo pipefail
101+
test -f "$TARGET/Dockerfile"
102+
test -f "$TARGET/.dockerignore"

docs/CPA_TEMPLATES_TRACKING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ uvx create-awesome-python-app@latest …
3131

3232
It must **not** check out this monorepo or fall back to `uv run` against a local source tree. That way green Actions means the same binary users install works with the templates under test.
3333

34-
CLI CI in this repo stays focused on unit/lint/type/smoke-distribution (`uvx` / Docker / brew / AUR).
34+
CLI CI in this repo stays focused on unit/lint/type, cross-platform scaffold
35+
smoke via published `uvx`, and smoke-distribution (`uvx` / Docker / brew / AUR).
3536

3637
## CNA parity reference
3738

0 commit comments

Comments
 (0)