5 Commits

Author SHA1 Message Date
user
da9859571b ci: Remove shellcheck, run deploy in container with host network
Some checks failed
Lint & Build / Security Flaw Analysis (push) Successful in 16s
Lint & Build / Secret Scanning (push) Successful in 4s
Lint & Build / C/C++ Static Analysis (push) Successful in 27s
Lint & Build / Build Firmware (push) Successful in 2m41s
Lint & Build / Deploy to ESP Fleet (push) Has been cancelled
- Remove shellcheck job (no shell scripts)
- Deploy job now uses espressif/idf container with --network=host
- Install git, curl, jq, netcat in deploy container
2026-02-05 22:54:16 +01:00
user
52603fb097 fix: Use git clone instead of curl for deploy checkout
Some checks failed
Lint & Build / Security Flaw Analysis (push) Successful in 15s
Lint & Build / Secret Scanning (push) Successful in 5s
Lint & Build / C/C++ Static Analysis (push) Successful in 28s
Lint & Build / Shell Script Analysis (push) Successful in 7s
Lint & Build / Build Firmware (push) Successful in 2m52s
Lint & Build / Deploy to ESP Fleet (push) Failing after 0s
2026-02-05 22:47:51 +01:00
user
974ffadb1c ci: Add firmware size check and version tag validation
Some checks failed
Lint & Build / Security Flaw Analysis (push) Successful in 15s
Lint & Build / Secret Scanning (push) Successful in 5s
Lint & Build / C/C++ Static Analysis (push) Successful in 28s
Lint & Build / Shell Script Analysis (push) Successful in 7s
Lint & Build / Build Firmware (push) Successful in 1m51s
Lint & Build / Deploy to ESP Fleet (push) Failing after 1s
- Fail build if binary exceeds 1920 KB partition
- Warn at 85% capacity
- Warn if git tag differs from embedded version
2026-02-05 22:42:49 +01:00
user
eb4c3d1657 feat: Add build metadata to STATUS, enable size optimization
STATUS now includes built=, idf=, chip= fields for diagnostics.
Switch to -Os compiler optimization (saves ~75 KB).
2026-02-05 22:42:45 +01:00
user
456b4f0b9a ci: Run build after checks pass, fix deploy checkout
All checks were successful
Lint & Build / Security Flaw Analysis (push) Successful in 15s
Lint & Build / Secret Scanning (push) Successful in 5s
Lint & Build / C/C++ Static Analysis (push) Successful in 27s
Lint & Build / Shell Script Analysis (push) Successful in 7s
Lint & Build / Build Firmware (push) Successful in 1m53s
Lint & Build / Deploy to ESP Fleet (push) Has been skipped
2026-02-05 22:24:38 +01:00
3 changed files with 61 additions and 33 deletions

View File

@@ -20,6 +20,7 @@ on:
jobs:
build:
name: Build Firmware
needs: [cppcheck, flawfinder, gitleaks]
runs-on: anvil
container:
image: docker.io/espressif/idf:v5.3
@@ -53,6 +54,26 @@ jobs:
run: |
ls -lh get-started/csi_recv_router/build/*.bin
- name: Check firmware size
run: |
BIN="get-started/csi_recv_router/build/csi_recv_router.bin"
MAX_SIZE=1966080 # 0x1E0000 = 1920 KB partition
WARN_PERCENT=85
SIZE=$(stat -c%s "$BIN")
PERCENT=$((SIZE * 100 / MAX_SIZE))
echo "Firmware: $((SIZE/1024)) KB / $((MAX_SIZE/1024)) KB ($PERCENT%)"
if [ $SIZE -gt $MAX_SIZE ]; then
echo "::error::Firmware exceeds partition size!"
exit 1
fi
if [ $PERCENT -gt $WARN_PERCENT ]; then
echo "::warning::Firmware using $PERCENT% of partition"
fi
- name: Upload firmware artifact
run: |
mkdir -p /tmp/artifacts
@@ -68,19 +89,40 @@ jobs:
runs-on: anvil
needs: build
if: github.event_name == 'workflow_dispatch' && github.event.inputs.deploy == 'true' || startsWith(github.ref, 'refs/tags/v')
# Run directly on host (no container) to access local network
container:
image: docker.io/espressif/idf:v5.3
options: --network=host
steps:
- name: Install tools
run: apt-get update && apt-get install -y --no-install-recommends git curl jq netcat-openbsd
- name: Checkout
run: git clone --depth=1 --branch=${{ github.ref_name }} https://oauth2:${{ github.token }}@git.mymx.me/${{ github.repository }}.git workspace
run: |
git clone --depth=1 --branch=${{ github.ref_name }} \
https://oauth2:${{ github.token }}@git.mymx.me/${{ github.repository }}.git .
- name: Build firmware
run: |
cd workspace && . $HOME/esp/esp-idf/export.sh && cd get-started/csi_recv_router && idf.py build
. /opt/esp/idf/export.sh
cd get-started/csi_recv_router
idf.py build
- name: Validate version tag
run: |
TAG="${{ github.ref_name }}"
# Extract version from binary metadata
BIN_VER=$(strings get-started/csi_recv_router/build/csi_recv_router.bin | grep -oP '^v\d+\.\d+(\.\d+)?' | head -1)
echo "Git tag: $TAG"
echo "Binary version: $BIN_VER"
if [ "$TAG" != "$BIN_VER" ]; then
echo "::warning::Tag ($TAG) differs from binary ($BIN_VER)"
fi
- name: Create release and upload firmware
env:
GITEA_TOKEN: ${{ github.token }}
working-directory: workspace
run: |
TAG="${{ github.ref_name }}"
REPO="${{ github.repository }}"
@@ -113,7 +155,6 @@ jobs:
"$API_URL/repos/$REPO/releases/$RELEASE_ID/assets?name=csi_recv_router.bin"
- name: Deploy via OTA
working-directory: workspace
run: |
SENSORS="muddy-storm:192.168.129.29 amber-maple:192.168.129.30 hollow-acorn:192.168.129.31"
OTA_PORT=8899
@@ -253,27 +294,3 @@ jobs:
- name: Run gitleaks
run: gitleaks detect --source . --verbose --redact
shellcheck:
name: Shell Script Analysis
runs-on: anvil
container:
image: docker.io/koalaman/shellcheck-alpine:stable
steps:
- name: Install git
run: apk add --no-cache git
- name: Checkout
run: |
git clone --depth=1 --branch=${{ github.ref_name }} \
https://oauth2:${{ github.token }}@git.mymx.me/${{ github.repository }}.git .
- name: Find and check shell scripts
run: |
SCRIPTS=$(find . -name "*.sh" -type f 2>/dev/null || true)
if [ -n "$SCRIPTS" ]; then
echo "Checking: $SCRIPTS"
echo "$SCRIPTS" | xargs shellcheck --severity=warning
else
echo "No shell scripts found, skipping"
fi

View File

@@ -36,6 +36,7 @@
#include "esp_ota_ops.h"
#include "esp_https_ota.h"
#include "esp_partition.h"
#include "esp_chip_info.h"
#include "esp_http_client.h"
#include "driver/gpio.h"
#include "soc/soc_caps.h"
@@ -1533,13 +1534,21 @@ static int cmd_handle(const char *cmd, char *reply, size_t reply_size)
const esp_partition_t *running = esp_ota_get_running_partition();
uint32_t part_size = running ? running->size : 0;
/* Chip info */
esp_chip_info_t chip_info;
esp_chip_info(&chip_info);
const char *chip_model = (chip_info.model == CHIP_ESP32S3) ? "ESP32S3" :
(chip_info.model == CHIP_ESP32C3) ? "ESP32C3" :
(chip_info.model == CHIP_ESP32) ? "ESP32" : "ESP32xx";
snprintf(reply, reply_size,
"OK STATUS uptime=%s uptime_s=%lld heap=%lu rssi=%d channel=%d tx_power=%d rate=%d csi_rate=%d"
" hostname=%s version=%s adaptive=%s motion=%d ble=%s target=%s:%d"
" temp=%.1f csi_count=%lu boots=%lu rssi_min=%d rssi_max=%d"
" csi_mode=%s hybrid_n=%d auth=%s flood_thresh=%d/%d powersave=%s"
" presence=%s pr_score=%.4f chanscan=%s"
" nvs_used=%lu nvs_free=%lu nvs_total=%lu part_size=%lu",
" nvs_used=%lu nvs_free=%lu nvs_total=%lu part_size=%lu"
" built=%s_%s idf=%s chip=%sr%dc%d",
uptime_str, (long long)up, (unsigned long)heap, rssi, channel, (int)s_tx_power_dbm,
s_send_frequency, actual_rate,
s_hostname, app_desc->version,
@@ -1556,7 +1565,9 @@ static int cmd_handle(const char *cmd, char *reply, size_t reply_size)
(unsigned long)nvs_stats.used_entries,
(unsigned long)nvs_stats.free_entries,
(unsigned long)nvs_stats.total_entries,
(unsigned long)part_size);
(unsigned long)part_size,
app_desc->date, app_desc->time, app_desc->idf_ver,
chip_model, chip_info.revision, chip_info.cores);
return strlen(reply);
}

View File

@@ -27,9 +27,9 @@ CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=
CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=
#
# Compiler options
# Compiler options (size optimization saves ~75 KB)
#
CONFIG_COMPILER_OPTIMIZATION_PERF=y
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
#
# FreeRTOS