ci: repair first-run workflow failures (#1)
## 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 <[email protected]>
This commit is contained in:
@@ -101,10 +101,15 @@ jobs:
|
|||||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
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
|
- name: Configure, build, and test
|
||||||
env:
|
env:
|
||||||
CC: gcc
|
CC: gcc-14
|
||||||
CXX: g++
|
CXX: g++-14
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cmake -S poc/host -B .build/host-gcc
|
cmake -S poc/host -B .build/host-gcc
|
||||||
@@ -149,6 +154,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
uv sync --frozen
|
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
|
- name: Build and collect LLVM coverage
|
||||||
env:
|
env:
|
||||||
CC: clang
|
CC: clang
|
||||||
@@ -156,6 +166,8 @@ jobs:
|
|||||||
LLVM_PROFILE_FILE: ${{ github.workspace }}/.build/coverage/profile-%p.profraw
|
LLVM_PROFILE_FILE: ${{ github.workspace }}/.build/coverage/profile-%p.profraw
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
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 -S poc/host -B .build/coverage -DENABLE_COVERAGE=ON
|
||||||
cmake --build .build/coverage --parallel 2
|
cmake --build .build/coverage --parallel 2
|
||||||
ctest --test-dir .build/coverage --output-on-failure
|
ctest --test-dir .build/coverage --output-on-failure
|
||||||
@@ -202,6 +214,7 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Configure and build dev firmware
|
- name: Configure and build dev firmware
|
||||||
run: |
|
run: |
|
||||||
|
. /opt/esp/idf/export.sh
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cmake --preset dev
|
cmake --preset dev
|
||||||
cmake --build --preset dev --parallel 2
|
cmake --build --preset dev --parallel 2
|
||||||
@@ -233,6 +246,7 @@ jobs:
|
|||||||
- name: Configure and build M1 firmware
|
- name: Configure and build M1 firmware
|
||||||
working-directory: poc/apps/m1_hardware
|
working-directory: poc/apps/m1_hardware
|
||||||
run: |
|
run: |
|
||||||
|
. /opt/esp/idf/export.sh
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cmake --preset default
|
cmake --preset default
|
||||||
cmake --build --preset default --parallel 2
|
cmake --build --preset default --parallel 2
|
||||||
@@ -251,7 +265,7 @@ jobs:
|
|||||||
include-hidden-files: true
|
include-hidden-files: true
|
||||||
|
|
||||||
required:
|
required:
|
||||||
name: required
|
name: CI / required
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
if: always()
|
if: always()
|
||||||
needs:
|
needs:
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ void console_service::print_status(bool json) const {
|
|||||||
char utc[32]{};
|
char utc[32]{};
|
||||||
if (value.rtc.valid) {
|
if (value.rtc.valid) {
|
||||||
const time_t seconds = static_cast<time_t>(value.rtc.unix_seconds);
|
const time_t seconds = static_cast<time_t>(value.rtc.unix_seconds);
|
||||||
struct tm utc_time{};
|
struct tm utc_time {};
|
||||||
if (gmtime_r(&seconds, &utc_time) != nullptr) {
|
if (gmtime_r(&seconds, &utc_time) != nullptr) {
|
||||||
const unsigned year = static_cast<unsigned>(utc_time.tm_year + 1900);
|
const unsigned year = static_cast<unsigned>(utc_time.tm_year + 1900);
|
||||||
std::snprintf(utc, sizeof(utc), "%04u-%02u-%02uT%02u:%02u:%02uZ", year,
|
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]{};
|
char rtc_text[32]{};
|
||||||
if (value.rtc.valid) {
|
if (value.rtc.valid) {
|
||||||
const time_t seconds = static_cast<time_t>(value.rtc.unix_seconds);
|
const time_t seconds = static_cast<time_t>(value.rtc.unix_seconds);
|
||||||
struct tm utc_time{};
|
struct tm utc_time {};
|
||||||
if (gmtime_r(&seconds, &utc_time) != nullptr) {
|
if (gmtime_r(&seconds, &utc_time) != nullptr) {
|
||||||
const unsigned year = static_cast<unsigned>(utc_time.tm_year + 1900);
|
const unsigned year = static_cast<unsigned>(utc_time.tm_year + 1900);
|
||||||
std::snprintf(
|
std::snprintf(
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ void format_rtc_time(const status_snapshot& value, char* output, std::size_t cap
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const time_t seconds = static_cast<time_t>(value.rtc.unix_seconds);
|
const time_t seconds = static_cast<time_t>(value.rtc.unix_seconds);
|
||||||
struct tm utc_time{};
|
struct tm utc_time {};
|
||||||
if (gmtime_r(&seconds, &utc_time) != nullptr) {
|
if (gmtime_r(&seconds, &utc_time) != nullptr) {
|
||||||
const unsigned year = static_cast<unsigned>(utc_time.tm_year + 1900);
|
const unsigned year = static_cast<unsigned>(utc_time.tm_year + 1900);
|
||||||
std::snprintf(
|
std::snprintf(
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ std::size_t format_status_log(const status_snapshot& status, uint64_t sequence,
|
|||||||
char utc[32]{};
|
char utc[32]{};
|
||||||
if (status.rtc.valid) {
|
if (status.rtc.valid) {
|
||||||
const time_t seconds = static_cast<time_t>(status.rtc.unix_seconds);
|
const time_t seconds = static_cast<time_t>(status.rtc.unix_seconds);
|
||||||
struct tm utc_time{};
|
struct tm utc_time {};
|
||||||
if (gmtime_r(&seconds, &utc_time) != nullptr) {
|
if (gmtime_r(&seconds, &utc_time) != nullptr) {
|
||||||
const unsigned year = static_cast<unsigned>(utc_time.tm_year + 1900);
|
const unsigned year = static_cast<unsigned>(utc_time.tm_year + 1900);
|
||||||
std::snprintf(
|
std::snprintf(
|
||||||
|
|||||||
Reference in New Issue
Block a user