Skip to content

Commit e4cabf8

Browse files
authored
Merge pull request #4987 from wled/copilot/fix-e93598cf-9ce2-4b3d-82dd-393eaf538463
Fix copilot-instructions.md to require mandatory hardware build validation
2 parents 3562fa2 + f034601 commit e4cabf8

File tree

1 file changed

+43
-10
lines changed

1 file changed

+43
-10
lines changed

.github/copilot-instructions.md

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,27 @@ The build has two main phases:
3030
- Common environments: `nodemcuv2`, `esp32dev`, `esp8266_2m`
3131
- List all targets: `pio run --list-targets`
3232

33+
## Before Finishing Work
34+
35+
**CRITICAL: You MUST complete ALL of these steps before marking your work as complete:**
36+
37+
1. **Run the test suite**: `npm test` -- Set timeout to 2+ minutes. NEVER CANCEL.
38+
- All tests MUST pass
39+
- If tests fail, fix the issue before proceeding
40+
41+
2. **Build at least one hardware environment**: `pio run -e esp32dev` -- Set timeout to 30+ minutes. NEVER CANCEL.
42+
- Choose `esp32dev` as it's a common, representative environment
43+
- See "Hardware Compilation" section above for the full list of common environments
44+
- The build MUST complete successfully without errors
45+
- If the build fails, fix the issue before proceeding
46+
- **DO NOT skip this step** - it validates that firmware compiles with your changes
47+
48+
3. **For web UI changes only**: Manually test the interface
49+
- See "Manual Testing Scenarios" section below
50+
- Verify the UI loads and functions correctly
51+
52+
**If any of these validation steps fail, you MUST fix the issues before finishing. Do NOT mark work as complete with failing builds or tests.**
53+
3354
## Validation and Testing
3455

3556
### Web UI Testing
@@ -44,7 +65,7 @@ The build has two main phases:
4465
- **Code style**: Use tabs for web files (.html/.css/.js), spaces (2 per level) for C++ files
4566
- **C++ formatting available**: `clang-format` is installed but not in CI
4667
- **Always run tests before finishing**: `npm test`
47-
- **Always run a build for the common environment before finishing**
68+
- **MANDATORY: Always run a hardware build before finishing** (see "Before Finishing Work" section below)
4869

4970
### Manual Testing Scenarios
5071
After making changes to web UI, always test:
@@ -100,10 +121,16 @@ package.json # Node.js dependencies and scripts
100121

101122
## Build Timing and Timeouts
102123

103-
- **Web UI build**: 3 seconds - Set timeout to 30 seconds minimum
104-
- **Test suite**: 40 seconds - Set timeout to 2 minutes minimum
105-
- **Hardware builds**: 15+ minutes - Set timeout to 30+ minutes minimum
106-
- **NEVER CANCEL long-running builds** - PlatformIO downloads and compilation can take significant time
124+
**IMPORTANT: Use these timeout values when running builds:**
125+
126+
- **Web UI build** (`npm run build`): 3 seconds typical - Set timeout to 30 seconds minimum
127+
- **Test suite** (`npm test`): 40 seconds typical - Set timeout to 120 seconds (2 minutes) minimum
128+
- **Hardware builds** (`pio run -e [target]`): 15-20 minutes typical for first build - Set timeout to 1800 seconds (30 minutes) minimum
129+
- Subsequent builds are faster due to caching
130+
- First builds download toolchains and dependencies which takes significant time
131+
- **NEVER CANCEL long-running builds** - PlatformIO downloads and compilation require patience
132+
133+
**When validating your changes before finishing, you MUST wait for the hardware build to complete successfully. Set the timeout appropriately and be patient.**
107134

108135
## Troubleshooting
109136

@@ -129,11 +156,17 @@ package.json # Node.js dependencies and scripts
129156
- **Hardware builds require appropriate ESP32/ESP8266 development board**
130157

131158
## CI/CD Pipeline
132-
The GitHub Actions workflow:
159+
160+
**The GitHub Actions CI workflow will:**
133161
1. Installs Node.js and Python dependencies
134-
2. Runs `npm test` to validate build system
135-
3. Builds web UI with `npm run build`
136-
4. Compiles firmware for multiple hardware targets
162+
2. Runs `npm test` to validate build system (MUST pass)
163+
3. Builds web UI with `npm run build` (automatically run by PlatformIO)
164+
4. Compiles firmware for ALL hardware targets listed in `default_envs` (MUST succeed for all)
137165
5. Uploads build artifacts
138166

139-
Match this workflow in your local development to ensure CI success.
167+
**To ensure CI success, you MUST locally:**
168+
- Run `npm test` and ensure it passes
169+
- Run `pio run -e esp32dev` (or another common environment from "Hardware Compilation" section) and ensure it completes successfully
170+
- If either fails locally, it WILL fail in CI
171+
172+
**Match this workflow in your local development to ensure CI success. Do not mark work complete until you have validated builds locally.**

0 commit comments

Comments
 (0)