Skip to content

build: add compile validation workflow#7

Merged
fjoelnr merged 1 commit intodevelopfrom
codex/hivetech-build-validation
Mar 22, 2026
Merged

build: add compile validation workflow#7
fjoelnr merged 1 commit intodevelopfrom
codex/hivetech-build-validation

Conversation

@fjoelnr
Copy link
Copy Markdown
Owner

@fjoelnr fjoelnr commented Mar 22, 2026

Summary

  • add a compile-only PlatformIO validation path with temporary config handling
  • declare required PlatformIO libraries and modernize ESP sleep includes for current frameworks
  • add a GitHub Actions firmware build workflow and document the new validation path

Verification

  • python -m platformio --version
  • python scripts/compile_check.py

@fjoelnr fjoelnr requested a review from ha-llm-bot as a code owner March 22, 2026 10:50
@fjoelnr fjoelnr merged commit 5732f83 into develop Mar 22, 2026
2 checks passed
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the firmware's build and validation process by introducing a dedicated compile-only workflow. This change streamlines development by providing a consistent and automated way to verify compilation without needing a full hardware setup, improving the reliability and maintainability of the codebase.

Highlights

  • Compile Validation Workflow: A new compile-only PlatformIO validation path has been introduced, including a Python script (scripts/compile_check.py) that handles temporary config.h files, ensuring that the firmware can be compiled without requiring a local configuration.
  • PlatformIO Library Declarations: Required PlatformIO libraries, specifically PubSubClient and SparkFun BME280, have been explicitly declared in platformio.ini to ensure consistent build environments.
  • ESP Sleep API Modernization: The ESP sleep includes and function calls have been updated to use the more modern <esp_sleep.h> header and corresponding API (esp_sleep_wakeup_cause_t, esp_sleep_get_wakeup_cause, esp_sleep_enable_timer_wakeup).
  • Documentation Updates: The README.md, docs/STATUS.md, docs/operations.md, and docs/verification.md files have been updated to reflect the new compile validation process and the status of CI/build validation.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/build.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a valuable compile validation workflow, making the build process more robust and CI-friendly. The changes include a new Python script for handling temporary configurations, explicit dependency declarations in platformio.ini, and updates to the documentation. Additionally, the ESP32 sleep API usage has been modernized. My review identified one high-severity issue in src/main.cpp where the API modernization inadvertently introduced a bug in downstream logic. The rest of the changes are well-implemented and significantly improve the project's structure.

Comment thread src/main.cpp
Comment on lines +50 to +52
esp_sleep_wakeup_cause_t wakeup_reason;

wakeup_reason = esp_deep_sleep_get_wakeup_cause();
wakeup_reason = esp_sleep_get_wakeup_cause();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

While updating the sleep API is a good modernization step, changing the type to esp_sleep_wakeup_cause_t and the function to esp_sleep_get_wakeup_cause() introduces a bug in the switch statement on lines 54-62. This statement uses hardcoded integer values (magic numbers) which are no longer correct, as the enum values for esp_sleep_wakeup_cause_t differ from the old API.

To fix this and improve code clarity, the switch statement should use the symbolic enum members instead of magic numbers. For example:

switch(wakeup_reason)
{
  case ESP_SLEEP_WAKEUP_TIMER: 
    Serial.println("Wakeup caused by timer"); 
    break;
  // ... other cases using enum members
  default: 
    Serial.println("Wakeup reason: " + String(wakeup_reason)); 
    break;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant