From c5ca557bd873e65bc464e9ca1bf2496bae472496 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Tue, 30 Sep 2025 13:15:11 -0500 Subject: [PATCH 01/16] feat: Add CI for tracking size deltas using new action --- .github/workflows/idf_size_pr.yml | 28 +++++++++++++ .github/workflows/idf_size_release.yml | 57 ++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 .github/workflows/idf_size_pr.yml create mode 100644 .github/workflows/idf_size_release.yml diff --git a/.github/workflows/idf_size_pr.yml b/.github/workflows/idf_size_pr.yml new file mode 100644 index 0000000..2101d0d --- /dev/null +++ b/.github/workflows/idf_size_pr.yml @@ -0,0 +1,28 @@ +name: esp-idf size delta (PR) + +on: + pull_request: + targets: + - main + +env: + # TODO: Update the below variables for your project + APP_NAME: "Template" + APP_PATH: . + IDF_VERSION: v5.5 + IDF_COMPONENT_MANAGER: "0" + FLASH_TOTAL_OVERRIDE: 1500000 + +jobs: + size-diff: + name: Size diff (${{ env.APP_PATH }}) + runs-on: ubuntu-latest + steps: + - name: Run reusable action + uses: esp-cpp/esp-idf-size-delta@main + with: + app_name: ${{ env.APP_NAME }} + app_path: ${{ env.APP_PATH }} + idf_version: ${{ env.IDF_VERSION }} + idf_component_manager: ${{ env.IDF_COMPONENT_MANAGER }} + base_ref: ${{ github.event.pull_request.base.sha }} diff --git a/.github/workflows/idf_size_release.yml b/.github/workflows/idf_size_release.yml new file mode 100644 index 0000000..bc62f7e --- /dev/null +++ b/.github/workflows/idf_size_release.yml @@ -0,0 +1,57 @@ +name: esp-idf release size delta (Release) + +on: + release: + types: [published] + workflow_dispatch: + inputs: + compare_tag: + description: 'Tag to compare against (leave empty to auto-select previous)' + required: false + default: '' + +permissions: + contents: write + +env: + # TODO: Update the below variables for your project + APP_NAME: "Template" + APP_PATH: . + IDF_VERSION: v5.5 + IDF_COMPONENT_MANAGER: "0" + FLASH_TOTAL_OVERRIDE: 1500000 + +jobs: + size-diff-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Determine base ref + id: base + shell: bash + run: | + set -euo pipefail + COMPARE_TAG_INPUT="${{ github.event.inputs.compare_tag || '' }}" + if [ -n "$COMPARE_TAG_INPUT" ]; then + echo "ref=$COMPARE_TAG_INPUT" >> "$GITHUB_OUTPUT" + else + # use the previous tag chronologically + prev=$(git tag --sort=-creatordate | sed -n '2p') + if [ -z "$prev" ]; then prev=$(git tag --sort=-v:refname | sed -n '2p'); fi + echo "ref=$prev" >> "$GITHUB_OUTPUT" + fi + + - name: Run reusable action + id: size + uses: ./.github/actions/esp-idf-size-delta + with: + app_name: ${{ env.APP_NAME }} + app_path: ${{ env.APP_PATH }} + idf_version: ${{ env.IDF_VERSION }} + idf_component_manager: ${{ env.IDF_COMPONENT_MANAGER }} + flash_total_override: ${{ env.FLASH_TOTAL_OVERRIDE }} + base_ref: ${{ steps.base.outputs.ref }} + post_comment: 'false' From ce86ef14c8908253eeb425236b144fd7c43d2d38 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Tue, 30 Sep 2025 13:18:24 -0500 Subject: [PATCH 02/16] fix env? --- .github/workflows/idf_size_pr.yml | 6 +++--- .github/workflows/idf_size_release.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/idf_size_pr.yml b/.github/workflows/idf_size_pr.yml index 2101d0d..cb0bed1 100644 --- a/.github/workflows/idf_size_pr.yml +++ b/.github/workflows/idf_size_pr.yml @@ -8,10 +8,10 @@ on: env: # TODO: Update the below variables for your project APP_NAME: "Template" - APP_PATH: . - IDF_VERSION: v5.5 + APP_PATH: '.' + IDF_VERSION: 'v5.5' IDF_COMPONENT_MANAGER: "0" - FLASH_TOTAL_OVERRIDE: 1500000 + FLASH_TOTAL_OVERRIDE: '1500000' jobs: size-diff: diff --git a/.github/workflows/idf_size_release.yml b/.github/workflows/idf_size_release.yml index bc62f7e..6d4dce2 100644 --- a/.github/workflows/idf_size_release.yml +++ b/.github/workflows/idf_size_release.yml @@ -16,10 +16,10 @@ permissions: env: # TODO: Update the below variables for your project APP_NAME: "Template" - APP_PATH: . - IDF_VERSION: v5.5 + APP_PATH: '.' + IDF_VERSION: 'v5.5' IDF_COMPONENT_MANAGER: "0" - FLASH_TOTAL_OVERRIDE: 1500000 + FLASH_TOTAL_OVERRIDE: '1500000' jobs: size-diff-release: From 1d38ac873efa3de7bc4c4ed350e644755f230754 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Tue, 30 Sep 2025 13:25:51 -0500 Subject: [PATCH 03/16] fix --- .github/workflows/idf_size_pr.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/idf_size_pr.yml b/.github/workflows/idf_size_pr.yml index cb0bed1..ea9e0e2 100644 --- a/.github/workflows/idf_size_pr.yml +++ b/.github/workflows/idf_size_pr.yml @@ -1,8 +1,8 @@ -name: esp-idf size delta (PR) +name: 'esp-idf size delta (PR)' on: pull_request: - targets: + branches: - main env: @@ -26,3 +26,4 @@ jobs: idf_version: ${{ env.IDF_VERSION }} idf_component_manager: ${{ env.IDF_COMPONENT_MANAGER }} base_ref: ${{ github.event.pull_request.base.sha }} + flash_total_override: ${{ env.FLASH_TOTAL_OVERRIDE }} From 14a6866c7097488eeb174a456ccb51ec75cd3937 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Tue, 30 Sep 2025 13:27:05 -0500 Subject: [PATCH 04/16] fix2 --- .github/workflows/idf_size_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/idf_size_pr.yml b/.github/workflows/idf_size_pr.yml index ea9e0e2..1aa4afc 100644 --- a/.github/workflows/idf_size_pr.yml +++ b/.github/workflows/idf_size_pr.yml @@ -15,7 +15,7 @@ env: jobs: size-diff: - name: Size diff (${{ env.APP_PATH }}) + name: Size diff runs-on: ubuntu-latest steps: - name: Run reusable action From 002b94c74228ab4af929df10af738045d8d6da9c Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Tue, 30 Sep 2025 14:03:42 -0500 Subject: [PATCH 05/16] enable release manager --- .github/workflows/idf_size_pr.yml | 2 +- .github/workflows/idf_size_release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/idf_size_pr.yml b/.github/workflows/idf_size_pr.yml index 1aa4afc..7d34c49 100644 --- a/.github/workflows/idf_size_pr.yml +++ b/.github/workflows/idf_size_pr.yml @@ -10,7 +10,7 @@ env: APP_NAME: "Template" APP_PATH: '.' IDF_VERSION: 'v5.5' - IDF_COMPONENT_MANAGER: "0" + IDF_COMPONENT_MANAGER: "1" FLASH_TOTAL_OVERRIDE: '1500000' jobs: diff --git a/.github/workflows/idf_size_release.yml b/.github/workflows/idf_size_release.yml index 6d4dce2..70259ce 100644 --- a/.github/workflows/idf_size_release.yml +++ b/.github/workflows/idf_size_release.yml @@ -18,7 +18,7 @@ env: APP_NAME: "Template" APP_PATH: '.' IDF_VERSION: 'v5.5' - IDF_COMPONENT_MANAGER: "0" + IDF_COMPONENT_MANAGER: "1" FLASH_TOTAL_OVERRIDE: '1500000' jobs: From 8ba60d88ada37a5b93d71d91a1af790b582c4383 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Tue, 30 Sep 2025 16:58:40 -0500 Subject: [PATCH 06/16] Fix release workflow --- .github/workflows/idf_size_release.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/idf_size_release.yml b/.github/workflows/idf_size_release.yml index 70259ce..83fa264 100644 --- a/.github/workflows/idf_size_release.yml +++ b/.github/workflows/idf_size_release.yml @@ -1,4 +1,4 @@ -name: esp-idf release size delta (Release) +name: 'esp-idf release size delta (Release)' on: release: @@ -45,8 +45,7 @@ jobs: fi - name: Run reusable action - id: size - uses: ./.github/actions/esp-idf-size-delta + uses: esp-cpp/esp-idf-size-delta@main with: app_name: ${{ env.APP_NAME }} app_path: ${{ env.APP_PATH }} From be4c3981bae92542eef978fee9253a9612f3f808 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Tue, 30 Sep 2025 17:06:20 -0500 Subject: [PATCH 07/16] simplify so that size is not run unless build succeeds --- .github/workflows/build.yml | 28 +++++++++++++++++++++---- .github/workflows/idf_size_pr.yml | 29 -------------------------- .github/workflows/idf_size_release.yml | 4 +++- 3 files changed, 27 insertions(+), 34 deletions(-) delete mode 100644 .github/workflows/idf_size_pr.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 30c5c00..affd5b1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,16 @@ name: Build +# TODO: update if you want to allow from forked repositories on: [pull_request] +env: + # TODO: Update the below variables for your project + APP_NAME: "Template" + IDF_TARGET: 'esp32' + IDF_VERSION: 'v5.5' + IDF_COMPONENT_MANAGER: "1" # whether to enable the component manager or not + FLASH_TOTAL_OVERRIDE: '1500000' # number of bytes of total flash (for percentage calculations) + jobs: build: @@ -10,11 +19,22 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 + # TODO: update this if you have submodules - name: Build main uses: espressif/esp-idf-ci-action@v1 with: - esp_idf_version: release-v5.5 - path: '.' - # TODO: set the target here to be the chip you are building for - # target: esp32s3 + esp_idf_version: ${{ env.IDF_VERSION }} + path: "." + target: ${{ env.IDF_TARGET }} + + - name: Determine Size Delta + uses: esp-cpp/esp-idf-size-delta@main + with: + app_name: ${{ env.APP_NAME }} + app_path: "." + idf_target: ${{ env.IDF_TARGET }} + idf_version: ${{ env.IDF_VERSION }} + idf_component_manager: ${{ env.IDF_COMPONENT_MANAGER }} + base_ref: ${{ github.event.pull_request.base.sha }} + flash_total_override: ${{ env.FLASH_TOTAL_OVERRIDE }} diff --git a/.github/workflows/idf_size_pr.yml b/.github/workflows/idf_size_pr.yml deleted file mode 100644 index 7d34c49..0000000 --- a/.github/workflows/idf_size_pr.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: 'esp-idf size delta (PR)' - -on: - pull_request: - branches: - - main - -env: - # TODO: Update the below variables for your project - APP_NAME: "Template" - APP_PATH: '.' - IDF_VERSION: 'v5.5' - IDF_COMPONENT_MANAGER: "1" - FLASH_TOTAL_OVERRIDE: '1500000' - -jobs: - size-diff: - name: Size diff - runs-on: ubuntu-latest - steps: - - name: Run reusable action - uses: esp-cpp/esp-idf-size-delta@main - with: - app_name: ${{ env.APP_NAME }} - app_path: ${{ env.APP_PATH }} - idf_version: ${{ env.IDF_VERSION }} - idf_component_manager: ${{ env.IDF_COMPONENT_MANAGER }} - base_ref: ${{ github.event.pull_request.base.sha }} - flash_total_override: ${{ env.FLASH_TOTAL_OVERRIDE }} diff --git a/.github/workflows/idf_size_release.yml b/.github/workflows/idf_size_release.yml index 83fa264..a86b36b 100644 --- a/.github/workflows/idf_size_release.yml +++ b/.github/workflows/idf_size_release.yml @@ -17,6 +17,7 @@ env: # TODO: Update the below variables for your project APP_NAME: "Template" APP_PATH: '.' + IDF_TARGET: 'esp32' IDF_VERSION: 'v5.5' IDF_COMPONENT_MANAGER: "1" FLASH_TOTAL_OVERRIDE: '1500000' @@ -44,11 +45,12 @@ jobs: echo "ref=$prev" >> "$GITHUB_OUTPUT" fi - - name: Run reusable action + - name: Determine Size Delta uses: esp-cpp/esp-idf-size-delta@main with: app_name: ${{ env.APP_NAME }} app_path: ${{ env.APP_PATH }} + idf_target: ${{ env.IDF_TARGET }} idf_version: ${{ env.IDF_VERSION }} idf_component_manager: ${{ env.IDF_COMPONENT_MANAGER }} flash_total_override: ${{ env.FLASH_TOTAL_OVERRIDE }} From b62d416305c25ecff415e12f22f25235fd15aba9 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Wed, 1 Oct 2025 08:46:11 -0500 Subject: [PATCH 08/16] update release workflow --- .github/workflows/idf_size_release.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/idf_size_release.yml b/.github/workflows/idf_size_release.yml index a86b36b..d63d228 100644 --- a/.github/workflows/idf_size_release.yml +++ b/.github/workflows/idf_size_release.yml @@ -1,14 +1,9 @@ -name: 'esp-idf release size delta (Release)' +name: 'ESP-IDF Size Delta (Release)' on: release: types: [published] workflow_dispatch: - inputs: - compare_tag: - description: 'Tag to compare against (leave empty to auto-select previous)' - required: false - default: '' permissions: contents: write From 4b7d56bfe9b5018326f714313567d75765ea168c Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Wed, 1 Oct 2025 08:49:44 -0500 Subject: [PATCH 09/16] update where permissions are stated --- .github/workflows/idf_size_release.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/idf_size_release.yml b/.github/workflows/idf_size_release.yml index d63d228..f29bac9 100644 --- a/.github/workflows/idf_size_release.yml +++ b/.github/workflows/idf_size_release.yml @@ -5,13 +5,9 @@ on: types: [published] workflow_dispatch: -permissions: - contents: write - env: # TODO: Update the below variables for your project APP_NAME: "Template" - APP_PATH: '.' IDF_TARGET: 'esp32' IDF_VERSION: 'v5.5' IDF_COMPONENT_MANAGER: "1" @@ -20,6 +16,8 @@ env: jobs: size-diff-release: runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@v4 with: @@ -44,7 +42,7 @@ jobs: uses: esp-cpp/esp-idf-size-delta@main with: app_name: ${{ env.APP_NAME }} - app_path: ${{ env.APP_PATH }} + app_path: "." idf_target: ${{ env.IDF_TARGET }} idf_version: ${{ env.IDF_VERSION }} idf_component_manager: ${{ env.IDF_COMPONENT_MANAGER }} From 8d2ccdef5a615e2d7975d0b85be6dbf7842a8730 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Wed, 1 Oct 2025 08:57:04 -0500 Subject: [PATCH 10/16] minor updates --- .github/workflows/idf_size_release.yml | 65 ++++++++++++++------------ README.md | 4 +- 2 files changed, 37 insertions(+), 32 deletions(-) diff --git a/.github/workflows/idf_size_release.yml b/.github/workflows/idf_size_release.yml index f29bac9..cbd6371 100644 --- a/.github/workflows/idf_size_release.yml +++ b/.github/workflows/idf_size_release.yml @@ -10,42 +10,45 @@ env: APP_NAME: "Template" IDF_TARGET: 'esp32' IDF_VERSION: 'v5.5' - IDF_COMPONENT_MANAGER: "1" - FLASH_TOTAL_OVERRIDE: '1500000' + IDF_COMPONENT_MANAGER: "1" # whether to enable the component manager or not + FLASH_TOTAL_OVERRIDE: '1500000' # number of bytes of total flash (for percentage calculations) jobs: - size-diff-release: + build: + runs-on: ubuntu-latest permissions: contents: write + steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 + # Checkout repo to get tags + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Determine base ref - id: base - shell: bash - run: | - set -euo pipefail - COMPARE_TAG_INPUT="${{ github.event.inputs.compare_tag || '' }}" - if [ -n "$COMPARE_TAG_INPUT" ]; then - echo "ref=$COMPARE_TAG_INPUT" >> "$GITHUB_OUTPUT" - else - # use the previous tag chronologically - prev=$(git tag --sort=-creatordate | sed -n '2p') - if [ -z "$prev" ]; then prev=$(git tag --sort=-v:refname | sed -n '2p'); fi - echo "ref=$prev" >> "$GITHUB_OUTPUT" - fi + - name: Determine base ref + id: base + shell: bash + run: | + set -euo pipefail + COMPARE_TAG_INPUT="${{ github.event.inputs.compare_tag || '' }}" + if [ -n "$COMPARE_TAG_INPUT" ]; then + echo "ref=$COMPARE_TAG_INPUT" >> "$GITHUB_OUTPUT" + else + # use the previous tag chronologically + prev=$(git tag --sort=-creatordate | sed -n '2p') + if [ -z "$prev" ]; then prev=$(git tag --sort=-v:refname | sed -n '2p'); fi + echo "ref=$prev" >> "$GITHUB_OUTPUT" + fi - - name: Determine Size Delta - uses: esp-cpp/esp-idf-size-delta@main - with: - app_name: ${{ env.APP_NAME }} - app_path: "." - idf_target: ${{ env.IDF_TARGET }} - idf_version: ${{ env.IDF_VERSION }} - idf_component_manager: ${{ env.IDF_COMPONENT_MANAGER }} - flash_total_override: ${{ env.FLASH_TOTAL_OVERRIDE }} - base_ref: ${{ steps.base.outputs.ref }} - post_comment: 'false' + - name: Determine Size Delta + uses: esp-cpp/esp-idf-size-delta@main + with: + app_name: ${{ env.APP_NAME }} + app_path: "." + idf_target: ${{ env.IDF_TARGET }} + idf_version: ${{ env.IDF_VERSION }} + idf_component_manager: ${{ env.IDF_COMPONENT_MANAGER }} + base_ref: ${{ steps.base.outputs.ref }} + flash_total_override: ${{ env.FLASH_TOTAL_OVERRIDE }} + post_comment: 'false' diff --git a/README.md b/README.md index f5ec701..df59a1d 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,9 @@ After setting this as the template, make sure to update the following: - The [./sdkconfig.defaults](./sdkconfig.defaults) to configure the defaults for your project / processor. - Update the [./.github/workflows/build.yml](./.github/workflows/build.yml) file - to have the correct target architecture (e.g. `esp32s3`) for your project. + to have the correct information for your project. +- Update the [./.github/workflows/idf_size_release.yml](./.github/workflows/idf_size_release.yml) file + to have the correct information for your project. - Update the [./.github/workflows/package_main.yml](./.github/workflows/package_main.yml) file to: - have the correct target architecture (e.g. `esp32s3`) for your project From f7d64cf4db9e4c484814cfb2efab7b0973103d1d Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Wed, 1 Oct 2025 08:59:47 -0500 Subject: [PATCH 11/16] update to calculate size in package_main --- .github/workflows/idf_size_release.yml | 54 -------------------------- .github/workflows/package_main.yml | 31 +++++++++++++++ README.md | 2 - 3 files changed, 31 insertions(+), 56 deletions(-) delete mode 100644 .github/workflows/idf_size_release.yml diff --git a/.github/workflows/idf_size_release.yml b/.github/workflows/idf_size_release.yml deleted file mode 100644 index cbd6371..0000000 --- a/.github/workflows/idf_size_release.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: 'ESP-IDF Size Delta (Release)' - -on: - release: - types: [published] - workflow_dispatch: - -env: - # TODO: Update the below variables for your project - APP_NAME: "Template" - IDF_TARGET: 'esp32' - IDF_VERSION: 'v5.5' - IDF_COMPONENT_MANAGER: "1" # whether to enable the component manager or not - FLASH_TOTAL_OVERRIDE: '1500000' # number of bytes of total flash (for percentage calculations) - -jobs: - build: - - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - # Checkout repo to get tags - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Determine base ref - id: base - shell: bash - run: | - set -euo pipefail - COMPARE_TAG_INPUT="${{ github.event.inputs.compare_tag || '' }}" - if [ -n "$COMPARE_TAG_INPUT" ]; then - echo "ref=$COMPARE_TAG_INPUT" >> "$GITHUB_OUTPUT" - else - # use the previous tag chronologically - prev=$(git tag --sort=-creatordate | sed -n '2p') - if [ -z "$prev" ]; then prev=$(git tag --sort=-v:refname | sed -n '2p'); fi - echo "ref=$prev" >> "$GITHUB_OUTPUT" - fi - - - name: Determine Size Delta - uses: esp-cpp/esp-idf-size-delta@main - with: - app_name: ${{ env.APP_NAME }} - app_path: "." - idf_target: ${{ env.IDF_TARGET }} - idf_version: ${{ env.IDF_VERSION }} - idf_component_manager: ${{ env.IDF_COMPONENT_MANAGER }} - base_ref: ${{ steps.base.outputs.ref }} - flash_total_override: ${{ env.FLASH_TOTAL_OVERRIDE }} - post_comment: 'false' diff --git a/.github/workflows/package_main.yml b/.github/workflows/package_main.yml index 2a2fcdc..ca6c7e2 100644 --- a/.github/workflows/package_main.yml +++ b/.github/workflows/package_main.yml @@ -19,6 +19,8 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Build Main Code uses: espressif/esp-idf-ci-action@v1 @@ -60,6 +62,35 @@ jobs: build/flasher_args.json build/flash_args + - name: Determine base ref + if: ${{ github.event.release && github.event.action == 'published' }} + id: base + shell: bash + run: | + set -euo pipefail + COMPARE_TAG_INPUT="${{ github.event.inputs.compare_tag || '' }}" + if [ -n "$COMPARE_TAG_INPUT" ]; then + echo "ref=$COMPARE_TAG_INPUT" >> "$GITHUB_OUTPUT" + else + # use the previous tag chronologically + prev=$(git tag --sort=-creatordate | sed -n '2p') + if [ -z "$prev" ]; then prev=$(git tag --sort=-v:refname | sed -n '2p'); fi + echo "ref=$prev" >> "$GITHUB_OUTPUT" + fi + + - name: Determine Size Delta + if: ${{ github.event.release && github.event.action == 'published' }} + uses: esp-cpp/esp-idf-size-delta@main + with: + app_name: ${{ env.APP_NAME }} + app_path: "." + idf_target: ${{ env.IDF_TARGET }} + idf_version: ${{ env.IDF_VERSION }} + idf_component_manager: ${{ env.IDF_COMPONENT_MANAGER }} + base_ref: ${{ steps.base.outputs.ref }} + flash_total_override: ${{ env.FLASH_TOTAL_OVERRIDE }} + post_comment: 'false' + package: name: Package the binaries into an executables for Windows, MacOS, and Linux (Ubuntu) needs: build diff --git a/README.md b/README.md index df59a1d..56290e6 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,6 @@ After setting this as the template, make sure to update the following: your project / processor. - Update the [./.github/workflows/build.yml](./.github/workflows/build.yml) file to have the correct information for your project. -- Update the [./.github/workflows/idf_size_release.yml](./.github/workflows/idf_size_release.yml) file - to have the correct information for your project. - Update the [./.github/workflows/package_main.yml](./.github/workflows/package_main.yml) file to: - have the correct target architecture (e.g. `esp32s3`) for your project From d9d7b3a3e51d823e13f2c05c4a211e6ad7985c50 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Wed, 1 Oct 2025 09:01:52 -0500 Subject: [PATCH 12/16] add missing env to package main --- .github/workflows/package_main.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/package_main.yml b/.github/workflows/package_main.yml index ca6c7e2..ef9ec57 100644 --- a/.github/workflows/package_main.yml +++ b/.github/workflows/package_main.yml @@ -7,12 +7,23 @@ on: types: [published] workflow_dispatch: +env: + # TODO: Update the below variables for your project + APP_NAME: "Template" + IDF_TARGET: 'esp32' + IDF_VERSION: 'v5.5' + IDF_COMPONENT_MANAGER: "1" # whether to enable the component manager or not + FLASH_TOTAL_OVERRIDE: '1500000' # number of bytes of total flash (for percentage calculations) + jobs: build: runs-on: ubuntu-latest continue-on-error: false + permissions: + contents: write + outputs: zipfile-id: ${{ steps.zip_step.outputs.artifact-id }} @@ -25,11 +36,9 @@ jobs: - name: Build Main Code uses: espressif/esp-idf-ci-action@v1 with: - esp_idf_version: release-v5.5 + esp_idf_version: ${{ env.IDF_VERSION }} path: '.' - command: 'idf.py build' - # TODO: set the target here to be the chip you are building for - # target: esp32s3 + target: ${{ env.IDF_TARGET }} - name: Upload Build Outputs uses: actions/upload-artifact@v4 From f824224dc555f7dfe230488366e6bf7dd3df2c8c Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Wed, 1 Oct 2025 09:02:45 -0500 Subject: [PATCH 13/16] update permissions --- .github/workflows/build.yml | 3 +++ .github/workflows/static_analysis.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index affd5b1..e70fe47 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,9 @@ jobs: runs-on: ubuntu-latest + permissions: + contents: write + steps: - name: Checkout repo uses: actions/checkout@v4 diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index fa36942..3df2f0d 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -11,6 +11,9 @@ jobs: static_analysis: runs-on: ubuntu-latest + permissions: + contents: write + steps: - name: Checkout repo uses: actions/checkout@v4 From af340d550969b474f82dd0a35a84c0f928a2ac41 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Wed, 1 Oct 2025 09:04:25 -0500 Subject: [PATCH 14/16] explicitly include atomic --- main/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/main/main.cpp b/main/main.cpp index 00f22dd..5db2a8e 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1,3 +1,4 @@ +#include #include #include From 4a265de07c360b522b117a0274b25526eee2df98 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Wed, 1 Oct 2025 09:08:04 -0500 Subject: [PATCH 15/16] update versions --- .github/workflows/build.yml | 4 ++-- .github/workflows/package_main.yml | 4 ++-- .github/workflows/static_analysis.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e70fe47..9d5e642 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 # TODO: update this if you have submodules - name: Build main @@ -32,7 +32,7 @@ jobs: target: ${{ env.IDF_TARGET }} - name: Determine Size Delta - uses: esp-cpp/esp-idf-size-delta@main + uses: esp-cpp/esp-idf-size-delta@v1 with: app_name: ${{ env.APP_NAME }} app_path: "." diff --git a/.github/workflows/package_main.yml b/.github/workflows/package_main.yml index ef9ec57..7bd5a7f 100644 --- a/.github/workflows/package_main.yml +++ b/.github/workflows/package_main.yml @@ -29,7 +29,7 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 @@ -89,7 +89,7 @@ jobs: - name: Determine Size Delta if: ${{ github.event.release && github.event.action == 'published' }} - uses: esp-cpp/esp-idf-size-delta@main + uses: esp-cpp/esp-idf-size-delta@v1 with: app_name: ${{ env.APP_NAME }} app_path: "." diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 3df2f0d..9a0524e 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Run static analysis uses: esp-cpp/StaticAnalysis@master From bc39d58d0899409570eda8b86a1a66bf28bd4ba1 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Wed, 1 Oct 2025 09:11:53 -0500 Subject: [PATCH 16/16] update permissions appropriately --- .github/workflows/build.yml | 2 +- .github/workflows/static_analysis.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d5e642..7bef6d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest permissions: - contents: write + issues: write steps: - name: Checkout repo diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 9a0524e..4d442d6 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest permissions: - contents: write + issues: write steps: - name: Checkout repo