Skip to content

promote: compile validation workflow to main#8

Merged
fjoelnr merged 3 commits intomainfrom
develop
Mar 22, 2026
Merged

promote: compile validation workflow to main#8
fjoelnr merged 3 commits intomainfrom
develop

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
Copy link
Copy Markdown
Collaborator

@ha-llm-bot ha-llm-bot left a comment

Choose a reason for hiding this comment

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

Reviewed for develop to main promotion.

Copy link
Copy Markdown
Collaborator

@ha-llm-bot ha-llm-bot left a comment

Choose a reason for hiding this comment

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

Reviewed for develop to main promotion.

@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 development and CI/CD workflow by introducing a robust compile-only validation mechanism for the firmware. It streamlines the build process by managing temporary configuration files, updates core ESP32 sleep API calls to modern standards, and explicitly defines project dependencies, all while thoroughly documenting these changes for improved clarity and maintainability.

Highlights

  • New Compile-Only Validation Workflow: Introduced a new script, scripts/compile_check.py, to enable compile-only validation for the firmware, which automatically handles temporary src/config.h creation and cleanup.
  • PlatformIO Configuration Updates: Updated platformio.ini to explicitly declare required libraries (PubSubClient and SparkFun BME280) and set the upload_protocol.
  • Modernized ESP32 Sleep API Usage: Migrated ESP32 deep sleep API calls from esp_deep_sleep.h to the more current esp_sleep.h and related functions across src/HiveTech.h and src/main.cpp.
  • Documentation Updates: Comprehensive documentation updates were made across README.md, docs/STATUS.md, docs/operations.md, and docs/verification.md to reflect the new validation process and project status.

🧠 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.

@fjoelnr fjoelnr merged commit f3167f5 into main Mar 22, 2026
4 checks passed
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-only validation workflow, complete with a Python helper script and updated documentation. The changes also modernize the ESP sleep API calls and correctly declare PlatformIO library dependencies, which are great improvements for maintainability and reproducibility. My review includes one suggestion to enhance the robustness of the new compile check script.

Comment thread scripts/compile_check.py
Comment on lines +9 to +33
def main() -> int:
repo_root = Path(__file__).resolve().parent.parent
src_dir = repo_root / "src"
config_path = src_dir / "config.h"
template_path = src_dir / "config_template.h"

created_temp_config = False
if not config_path.exists():
shutil.copyfile(template_path, config_path)
created_temp_config = True
print(f"created temporary config: {config_path}")
else:
print(f"using existing local config: {config_path}")

try:
result = subprocess.run(
[sys.executable, "-m", "platformio", "run"],
cwd=repo_root,
check=False,
)
return result.returncode
finally:
if created_temp_config and config_path.exists():
config_path.unlink()
print(f"removed temporary config: {config_path}")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The script doesn't handle the case where src/config_template.h is missing and will crash with a FileNotFoundError. It would be more robust to add an explicit check for the template file at the beginning of the function and exit with a user-friendly error message. This improves the script's robustness and user experience in a clear failure scenario.

def main() -> int:
    repo_root = Path(__file__).resolve().parent.parent
    src_dir = repo_root / "src"
    config_path = src_dir / "config.h"
    template_path = src_dir / "config_template.h"

    if not template_path.exists():
        print(f"error: template config not found: {template_path}", file=sys.stderr)
        return 1

    created_temp_config = False
    if not config_path.exists():
        shutil.copyfile(template_path, config_path)
        created_temp_config = True
        print(f"created temporary config: {config_path}")
    else:
        print(f"using existing local config: {config_path}")

    try:
        result = subprocess.run(
            [sys.executable, "-m", "platformio", "run"],
            cwd=repo_root,
            check=False,
        )
        return result.returncode
    finally:
        if created_temp_config and config_path.exists():
            config_path.unlink()
            print(f"removed temporary config: {config_path}")

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.

2 participants