From d73cadbcd6666951418681bf3ece841351cd6057 Mon Sep 17 00:00:00 2001 From: Lain <66010445+Aniakea@users.noreply.github.com> Date: Mon, 31 Aug 2026 09:04:01 +0800 Subject: [PATCH] ci: repair first-run workflow failures (#1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Root causes (run 33344835245) | Job | Cause | Fix | |---|---|---| | Host GCC compatibility | Runner GCC 13.3 has no `-std=c++26`; `poc/host` sets `CMAKE_CXX_STANDARD 26` | Install `gcc-14`/`g++-14`, set `CC`/`CXX` | | Host branch coverage | `llvm-profdata: command not found` (clang-18 present, LLVM tools absent) | Install `llvm-18`, prepend `/usr/lib/llvm-18/bin` to PATH | | ESP-IDF dev firmware | `cmake: command not found` — action overrides container entrypoint so the IDF env is never sourced | Source `. /opt/esp/idf/export.sh` in the build step | | ESP-IDF M1 hardware firmware | same as above | same | | Repository gates | clang-format v22-formatted sources vs CI clang-format-18 (console_service.cc:260,300; display_service.cc:31; status_log.cc:34) | Reformatted with clang-format 18.1.8 semantics; full dry-run green | | Gitleaks | No secret finding: the push-event scan range referenced stale pre-rewrite revision `7bae861` (unknown revision); scan infra failed | No change — one-time bootstrap artifact; PR/post-merge events have valid ranges (verified by this run) | Host Clang ASan/UBSan and Host clang-tidy were already green; `required` is the aggregate. Formatting diffs are formatting-only (`struct tm utc_time{}` -> `struct tm utc_time {}`). --------- Co-authored-by: ania-lain --- .github/workflows/ci.yml | 20 +++++++++++++++++--- poc/apps/m1_hardware/main/console_service.cc | 4 ++-- poc/apps/m1_hardware/main/display_service.cc | 2 +- poc/apps/m1_hardware/main/status_log.cc | 2 +- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac4a142..d4448bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,10 +101,15 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with: persist-credentials: false + - name: Install GCC 14 toolchain + run: | + set -euo pipefail + sudo apt-get update + sudo apt-get install -y gcc-14 g++-14 - name: Configure, build, and test env: - CC: gcc - CXX: g++ + CC: gcc-14 + CXX: g++-14 run: | set -euo pipefail cmake -S poc/host -B .build/host-gcc @@ -149,6 +154,11 @@ jobs: run: | set -euo pipefail uv sync --frozen + - name: Install LLVM coverage tools + run: | + set -euo pipefail + sudo apt-get update + sudo apt-get install -y llvm-18 - name: Build and collect LLVM coverage env: CC: clang @@ -156,6 +166,8 @@ jobs: LLVM_PROFILE_FILE: ${{ github.workspace }}/.build/coverage/profile-%p.profraw run: | set -euo pipefail + export PATH="/usr/lib/llvm-18/bin:$PATH" + llvm-profdata --version | head -n 1 cmake -S poc/host -B .build/coverage -DENABLE_COVERAGE=ON cmake --build .build/coverage --parallel 2 ctest --test-dir .build/coverage --output-on-failure @@ -202,6 +214,7 @@ jobs: persist-credentials: false - name: Configure and build dev firmware run: | + . /opt/esp/idf/export.sh set -euo pipefail cmake --preset dev cmake --build --preset dev --parallel 2 @@ -233,6 +246,7 @@ jobs: - name: Configure and build M1 firmware working-directory: poc/apps/m1_hardware run: | + . /opt/esp/idf/export.sh set -euo pipefail cmake --preset default cmake --build --preset default --parallel 2 @@ -251,7 +265,7 @@ jobs: include-hidden-files: true required: - name: required + name: CI / required runs-on: ubuntu-24.04 if: always() needs: diff --git a/poc/apps/m1_hardware/main/console_service.cc b/poc/apps/m1_hardware/main/console_service.cc index 262de24..d26091e 100644 --- a/poc/apps/m1_hardware/main/console_service.cc +++ b/poc/apps/m1_hardware/main/console_service.cc @@ -257,7 +257,7 @@ void console_service::print_status(bool json) const { char utc[32]{}; if (value.rtc.valid) { const time_t seconds = static_cast(value.rtc.unix_seconds); - struct tm utc_time{}; + struct tm utc_time {}; if (gmtime_r(&seconds, &utc_time) != nullptr) { const unsigned year = static_cast(utc_time.tm_year + 1900); std::snprintf(utc, sizeof(utc), "%04u-%02u-%02uT%02u:%02u:%02uZ", year, @@ -297,7 +297,7 @@ void console_service::print_status(bool json) const { char rtc_text[32]{}; if (value.rtc.valid) { const time_t seconds = static_cast(value.rtc.unix_seconds); - struct tm utc_time{}; + struct tm utc_time {}; if (gmtime_r(&seconds, &utc_time) != nullptr) { const unsigned year = static_cast(utc_time.tm_year + 1900); std::snprintf( diff --git a/poc/apps/m1_hardware/main/display_service.cc b/poc/apps/m1_hardware/main/display_service.cc index 2b5236c..cd879be 100644 --- a/poc/apps/m1_hardware/main/display_service.cc +++ b/poc/apps/m1_hardware/main/display_service.cc @@ -28,7 +28,7 @@ void format_rtc_time(const status_snapshot& value, char* output, std::size_t cap return; } const time_t seconds = static_cast(value.rtc.unix_seconds); - struct tm utc_time{}; + struct tm utc_time {}; if (gmtime_r(&seconds, &utc_time) != nullptr) { const unsigned year = static_cast(utc_time.tm_year + 1900); std::snprintf( diff --git a/poc/apps/m1_hardware/main/status_log.cc b/poc/apps/m1_hardware/main/status_log.cc index 682ac1a..f565b87 100644 --- a/poc/apps/m1_hardware/main/status_log.cc +++ b/poc/apps/m1_hardware/main/status_log.cc @@ -31,7 +31,7 @@ std::size_t format_status_log(const status_snapshot& status, uint64_t sequence, char utc[32]{}; if (status.rtc.valid) { const time_t seconds = static_cast(status.rtc.unix_seconds); - struct tm utc_time{}; + struct tm utc_time {}; if (gmtime_r(&seconds, &utc_time) != nullptr) { const unsigned year = static_cast(utc_time.tm_year + 1900); std::snprintf(