Skip to content

More code cleanup

More code cleanup #15

Workflow file for this run

name: ESP-IDF Builds
on:
push:
branches: ["**"]
pull_request:
concurrency:
group: esp-idf-build-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build (${{ matrix.project }})
runs-on: ubuntu-latest
# Official ESP-IDF container (includes toolchains + Python deps)
container:
image: espressif/idf:release-v5.5
strategy:
fail-fast: false
matrix:
project:
- static_test_card
- streaming_gif
- pong
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache ccache
uses: actions/cache@v4
with:
path: /root/.ccache
# Per-project cache; restores across commits and re-saves when contents change.
key: ${{ runner.os }}-ccache-${{ matrix.project }}-${{ hashFiles(format('{0}/sdkconfig', matrix.project), format('{0}/sdkconfig.defaults', matrix.project), format('{0}/sdkconfig.ci', matrix.project), format('{0}/CMakeLists.txt', matrix.project), format('{0}/main/CMakeLists.txt', matrix.project), format('{0}/dependencies.lock', matrix.project)) }}
restore-keys: |
${{ runner.os }}-ccache-${{ matrix.project }}-
${{ runner.os }}-ccache-
- name: Build
shell: bash
env:
IDF_CCACHE_ENABLE: "1"
CCACHE_DIR: /root/.ccache
IDF_TARGET: esp32s3
run: |
set -euo pipefail
# Location differs slightly across ESP-IDF container tags.
if [[ -f /opt/esp/idf/export.sh ]]; then
source /opt/esp/idf/export.sh
elif [[ -f /opt/esp/esp-idf/export.sh ]]; then
source /opt/esp/esp-idf/export.sh
else
echo "ERROR: ESP-IDF export.sh not found under /opt/esp"
ls -la /opt/esp || true
exit 1
fi
echo "ESP-IDF version:"
idf.py --version
# Ensure a clean build (avoid reusing committed local build artifacts)
rm -rf "${{ matrix.project }}/build"
# Explicitly set target for fresh CI builds (otherwise defaults to esp32)
idf.py -C "${{ matrix.project }}" set-target esp32s3
# If a project provides CI overrides, merge them on top of sdkconfig.
# (Kconfig will take the last assignment for duplicated CONFIG_ entries.)
if [[ -f "${{ matrix.project }}/sdkconfig.ci" ]]; then
echo "Applying ${{ matrix.project }}/sdkconfig.ci overrides"
cat "${{ matrix.project }}/sdkconfig" "${{ matrix.project }}/sdkconfig.ci" > "${{ matrix.project }}/sdkconfig.merged"
mv "${{ matrix.project }}/sdkconfig.merged" "${{ matrix.project }}/sdkconfig"
fi
# set-target may have created build/; ensure we rebuild from scratch with the final sdkconfig
rm -rf "${{ matrix.project }}/build"
idf.py -C "${{ matrix.project }}" build