Skip to content

Commit 786d330

Browse files
JnyJnyclaude
andcommitted
Optimize release workflow with test validation and fast test subset
- Remove incomplete release.yaml stub workflow - Add poe test-fast task for quick validation (26 tests, ~35 seconds) - Update GitHub release workflow to run fast tests before creating releases - Release job now depends on test job passing - Update CLAUDE.md with testing strategy and performance documentation - Maintain comprehensive test suite (103 tests) for full validation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent d2b75d9 commit 786d330

File tree

4 files changed

+37
-68
lines changed

4 files changed

+37
-68
lines changed

.github/workflows/github-release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,35 @@ permissions:
1010
pull-requests: read
1111

1212
jobs:
13+
test:
14+
name: Run Tests
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v6
23+
with:
24+
python-version: "3.12"
25+
26+
- name: Create Bogus Git Configuration
27+
env:
28+
GITHUB_NAME: "NOBODY"
29+
GITHUB_EMAIL: "[email protected]"
30+
run: |
31+
git config --global user.name "$GITHUB_NAME"
32+
git config --global user.email "$GITHUB_EMAIL"
33+
34+
- name: Run Fast Test Suite
35+
run: |
36+
uv run pytest -m 'not slow and not integration and not cross_platform' --ignore=tests/test_configuration_matrix.py --ignore=tests/test_generate_projects.py tests/
37+
1338
release:
1439
name: Create GitHub Release
1540
runs-on: ubuntu-latest
41+
needs: test
1642

1743
steps:
1844
- name: Checkout

.github/workflows/release.yaml

Lines changed: 0 additions & 63 deletions
This file was deleted.

CLAUDE.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This is a Cookiecutter template for creating Python packages with modern tooling
99
## Key Commands
1010

1111
### Testing the Template
12-
- `pytest` - Run comprehensive test suite covering multiple aspects:
12+
- `pytest` - Run full test suite (103 tests, ~5-15 minutes):
1313
- Template configuration validation (`test_cookiecutter_json.py`)
1414
- Project generation with all configuration combinations (`test_generate_projects.py`)
1515
- Generated project poe tasks functionality (`test_poe_tasks.py`)
@@ -20,6 +20,7 @@ This is a Cookiecutter template for creating Python packages with modern tooling
2020
- Edge cases and error handling (`test_edge_cases.py`)
2121
- End-to-end integration workflows (`test_integration.py`)
2222
- Default project baseline validation (`test_default_project.py`)
23+
- `poe test-fast` - Run fast test subset (26 tests, ~35 seconds) for release validation
2324
- `poe ruff` - Run ruff check and format on template code
2425
- `poe test` - Run pytest (alias for pytest)
2526

@@ -129,6 +130,7 @@ The comprehensive test suite validates multiple aspects of the template:
129130
- **Subprocess Execution**: Real command behavior validation
130131
- **File System Validation**: Structure and content verification
131132
- **Performance Markers**: Separation of fast/slow tests for CI optimization
133+
- **Test Subsets**: Fast subset (26 tests, 35s) for releases; full suite (103 tests, 5-15m) for comprehensive validation
132134

133135
## Common Workflows
134136

@@ -158,10 +160,11 @@ When testing or modifying GitHub workflows:
158160

159161
**For the Cookiecutter Template Repository:**
160162
1. Update code and commit changes
161-
2. Run `poe changelog` to preview changes since last tag
162-
3. Run `poe release-notes` to generate release notes
163-
4. Use `poe release_patch/minor/major` to bump version, commit, tag, and push
164-
5. GitHub Actions automatically create GitHub release with generated notes
163+
2. Run `poe test-fast` to validate core functionality (optional, but recommended)
164+
3. Run `poe changelog` to preview changes since last tag
165+
4. Run `poe release-notes` to generate release notes
166+
5. Use `poe release_patch/minor/major` to bump version, commit, tag, and push
167+
6. GitHub Actions automatically run fast test suite and create GitHub release (only if tests pass)
165168

166169
**For Generated Projects:**
167170
Generated projects follow this release workflow:

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ dev = [
2020
test.cmd = "pytest"
2121
test.help = "Test cookiecutter package."
2222

23+
test-fast.cmd = "pytest -m 'not slow and not integration and not cross_platform' --ignore=tests/test_configuration_matrix.py --ignore=tests/test_generate_projects.py tests/"
24+
test-fast.help = "Run fast subset of tests for release validation."
25+
2326
ruff_check.cmd = "ruff check hooks tests"
2427
ruff_check.help = "ruff check on hooks and tests."
2528

0 commit comments

Comments
 (0)