From 5cb87c5bafe19e3e280e5fe395e58316c7a827d9 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 10 Oct 2025 07:33:17 -1000 Subject: [PATCH] docs --- .github/workflows/ci.yml | 16 +++++++++------- script/test_build_components.py | 23 +++++++++++++++++++++++ 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22a6cdbb75..ad81ba64a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -435,13 +435,10 @@ jobs: matrix: components: ${{ fromJson(needs.test-build-components-splitter.outputs.matrix) }} steps: - - name: Free up disk space + - name: Show disk space run: | - echo "Disk space before cleanup:" + echo "Available disk space:" df -h - echo "Starting background cleanup process..." - python3 -c "import os; os.fork() or os.execvp('sudo', ['sudo', 'rm', '-rf', '/usr/share/dotnet', '/usr/local/lib/android', '/opt/ghc', '/opt/hostedtoolcache/CodeQL'])" - echo "Cleanup running in background, continuing with workflow..." - name: List components run: echo ${{ matrix.components }} @@ -462,8 +459,13 @@ jobs: - name: Validate and compile components with intelligent grouping run: | . venv/bin/activate - mkdir -p build_cache - export PLATFORMIO_BUILD_CACHE_DIR=$PWD/build_cache + # Use /mnt for build files (70GB available vs ~29GB on /) + mkdir -p /mnt/build_cache + export PLATFORMIO_BUILD_CACHE_DIR=/mnt/build_cache + + # Also move test_build_components/build to /mnt + mkdir -p /mnt/test_build_components_build + ln -s /mnt/test_build_components_build tests/test_build_components/build # Convert space-separated components to comma-separated for Python script components_csv=$(echo "${{ matrix.components }}" | tr ' ' ',') diff --git a/script/test_build_components.py b/script/test_build_components.py index 06ba860c26..c6045f2a3e 100755 --- a/script/test_build_components.py +++ b/script/test_build_components.py @@ -18,6 +18,7 @@ from __future__ import annotations import argparse from collections import defaultdict import hashlib +import os from pathlib import Path import subprocess import sys @@ -38,6 +39,20 @@ from script.analyze_component_buses import ( from script.merge_component_configs import merge_component_configs +def show_disk_space_if_ci(esphome_command: str) -> None: + """Show disk space usage if running in CI during compile. + + Args: + esphome_command: The esphome command being run (config/compile/clean) + """ + if os.environ.get("GITHUB_ACTIONS") and esphome_command == "compile": + print("\n" + "=" * 80) + print("Disk Space After Build:") + print("=" * 80) + subprocess.run(["df", "-h"], check=False) + print("=" * 80 + "\n") + + def find_component_tests( components_dir: Path, component_pattern: str = "*" ) -> dict[str, list[Path]]: @@ -200,6 +215,10 @@ def run_esphome_test( try: result = subprocess.run(cmd, check=False) success = result.returncode == 0 + + # Show disk space after build in CI during compile + show_disk_space_if_ci(esphome_command) + if not success and not continue_on_fail: # Print command immediately for failed tests print(f"\n{'=' * 80}") @@ -309,6 +328,10 @@ def run_grouped_test( try: result = subprocess.run(cmd, check=False) success = result.returncode == 0 + + # Show disk space after build in CI during compile + show_disk_space_if_ci(esphome_command) + if not success and not continue_on_fail: # Print command immediately for failed tests print(f"\n{'=' * 80}")