Skip to content

Commit ffc89dc

Browse files
ci: CI shortened queue time (#156)
* discard draft trigger CI * flag trigger and error * few more stages for dispatch * testing ci * check geos-integration ci * fix bash * spare some time * retrigger with flag * remove GEOS integrated part and flag * reorder and more verbose * Update conditional logic and add comments * Update README file * Avoid redundancy in summary --------- Co-authored-by: alexbenedicto <[email protected]>
1 parent 754d2e0 commit ffc89dc

File tree

3 files changed

+244
-35
lines changed

3 files changed

+244
-35
lines changed

.github/workflows/README.md

Lines changed: 98 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,15 @@ semantic_pull_request:
4141
- Examples: `feat: add new feature`, `fix(mesh): resolve bug`
4242
```
4343
44-
#### 2. Build and Test
44+
#### 2. Draft PR Check
45+
```yaml
46+
check_draft:
47+
- Fails CI if PR is still in draft mode
48+
- Prevents accidental merging of incomplete work
49+
- Mark PR as "Ready for review" to proceed
50+
```
51+
52+
#### 3. Build and Test
4553
```yaml
4654
build:
4755
- Matrix testing across Python 3.10, 3.11, 3.12
@@ -50,22 +58,39 @@ build:
5058
- Runs pytest tests
5159
```
5260
53-
#### 3. GEOS Integration Check
61+
#### 4. Label Checks
62+
```yaml
63+
check_integration_label:
64+
- Checks for 'test-geos-integration' label
65+
66+
check_force_integration_label:
67+
- Checks for 'force-geos-integration' label
68+
```
69+
70+
#### 5. GEOS Integration Required Check
5471
```yaml
5572
check_geos_integration_required:
5673
- Analyzes changed files
5774
- Determines if GEOS integration tests are needed
5875
- See "Smart GEOS Integration Testing" section below
5976
```
6077
61-
#### 4. GEOS Integration Test (Conditional)
78+
#### 6. GEOS CI Dispatch
79+
```yaml
80+
geos_ci_dispatch:
81+
- Evaluates label + file change requirements
82+
- Decides whether to run, skip, or fail
83+
- Provides clear error messages for incorrect label usage
84+
```
85+
86+
#### 7. GEOS Integration Test (Conditional)
6287
```yaml
6388
geos_integration_test:
64-
- Only runs if required by file changes or label
89+
- Only runs if dispatch job says to proceed
6590
- Calls test_geos_integration.yml workflow
6691
```
6792
68-
#### 5. Final Validation
93+
#### 8. Final Validation
6994
```yaml
7095
final_validation:
7196
- Summarizes all test results
@@ -249,35 +274,78 @@ Tests are automatically skipped when changes only affect:
249274
- `.github/workflows/doc-test.yml` - Documentation CI
250275
- `.github/workflows/typing-check.yml` - Type checking CI
251276

252-
### Manual Override
277+
### Manual Override Labels
278+
279+
The CI supports two labels for controlling GEOS integration tests:
280+
281+
1. **`test-geos-integration`** - Must be added when changes affect GEOS-integrated packages
282+
- Required when modifying: `geos-utils`, `geos-mesh`, `geos-xml-tools`, `hdf5-wrapper`, `pygeos-tools`, `geos-ats`
283+
- CI will fail if this label is missing when required
284+
- CI will warn if this label is present but not needed (suggest using `force-geos-integration` instead)
285+
286+
2. **`force-geos-integration`** - Forces tests to run regardless of changed files
287+
- Use this when testing CI changes themselves
288+
- Use this for docs/config-only PRs where you want to verify GEOS integration still works
289+
- Overrides all other logic - tests will always run
290+
291+
### Label Decision Logic
292+
293+
The CI uses the following decision matrix:
253294

254-
Add the **`test-geos-integration`** label to any PR to force GEOS integration tests to run, regardless of changed files.
295+
| GEOS Required<br/>(by file changes) | `test-geos-integration`<br/>label | `force-geos-integration`<br/>label | Result |
296+
|-------------------------------------|-----------------------------------|-------------------------------------|--------|
297+
| - | - | ✅ Yes |**Run tests** (forced) |
298+
| ✅ Yes | ✅ Yes | ❌ No |**Run tests** (normal) |
299+
| ✅ Yes | ❌ No | ❌ No |**ERROR** - Label required |
300+
| ❌ No | ✅ Yes | ❌ No |**Skip** - Wrong label (use force instead) |
301+
| ❌ No | ❌ No | ❌ No |**Skip tests** (not needed) |
255302

256303
### Example Scenarios
257304

258-
**Tests Will Run**
305+
**Tests Will Run (Required + Label)**
259306
```
260307
Changes:
261308
- geos-mesh/src/mesh_converter.py
262309
- geos-xml-tools/src/preprocessor.py
263-
Result: GEOS integration required (affects integrated packages)
310+
Labels: test-geos-integration
311+
Result: GEOS integration will run (changes affect integrated packages)
264312
```
265313

266-
**Tests Will Skip**
314+
**CI Will Fail (Required but Missing Label)**
315+
```
316+
Changes:
317+
- geos-utils/src/table_loader.py
318+
- hdf5-wrapper/src/wrapper.py
319+
Labels: (none)
320+
Result: ERROR - 'test-geos-integration' label required
321+
```
322+
323+
**Tests Will Skip (Not Required)**
267324
```
268325
Changes:
269326
- docs/user_guide.md
270327
- README.md
271328
- geos-pv/src/visualizer.py
272-
Result: GEOS integration not required (only docs and non-integrated packages)
329+
Labels: (none)
330+
Result: GEOS integration not required (skipped)
273331
```
274332

275-
**Tests Will Run (Manual)**
333+
**Tests Will Skip (Wrong Label)**
276334
```
277335
Changes:
278336
- docs/installation.md
337+
- .style.yapf
279338
Labels: test-geos-integration
280-
Result: GEOS integration required (manual override via label)
339+
Result: Warning - Label not needed, use 'force-geos-integration' to force tests (skipped)
340+
```
341+
342+
**Tests Will Run (Forced)**
343+
```
344+
Changes:
345+
- docs/installation.md
346+
- .github/workflows/python-package.yml
347+
Labels: force-geos-integration
348+
Result: GEOS integration forced (tests will run regardless of changes)
281349
```
282350

283351
## GEOS Integration: How It Works
@@ -393,6 +461,23 @@ When adding new Python packages or modifying existing ones:
393461
4. **Test Integration**:
394462
- If package integrates with GEOS, add `test-geos-integration` label to PR
395463
- Verify all 5 integration tests pass
464+
- If only testing CI changes on a docs PR, use `force-geos-integration` label
465+
466+
### PR Label Usage Guide
467+
468+
**For PR Authors:**
469+
470+
| Your PR Changes | Required Label | What Happens |
471+
|-----------------|----------------|--------------|
472+
| GEOS-integrated packages<br/>(utils, mesh, xml-tools, etc.) | `test-geos-integration` | ✅ Tests run (required) |
473+
| Docs/config only | (none) | ⊘ Tests skipped |
474+
| Docs + you want to test integration | `force-geos-integration` | ✅ Tests run (forced) |
475+
| CI workflow files | `force-geos-integration` | ✅ Tests run (verify CI works) |
476+
477+
**Common Mistakes:**
478+
- ❌ Modifying `geos-mesh/` without label → CI fails, add `test-geos-integration`
479+
- ❌ Adding `test-geos-integration` to docs-only PR → Warning, remove label or use `force-geos-integration`
480+
- ✅ Modifying `.github/workflows/` with `force-geos-integration` → Tests run to verify CI changes
396481

397482
## References
398483

0 commit comments

Comments
 (0)