Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,43 @@
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:

runs-on: ubuntu-latest

permissions:
issues: write

steps:
- name: Checkout repo
uses: actions/checkout@v4
uses: actions/checkout@v5
# 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@v1
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 }}
50 changes: 45 additions & 5 deletions .github/workflows/package_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,38 @@ 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 }}

steps:
- name: Checkout repo
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

- 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
Expand Down Expand Up @@ -60,6 +71,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@v1
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
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ jobs:
static_analysis:
runs-on: ubuntu-latest

permissions:
issues: write

steps:
- name: Checkout repo
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Run static analysis
uses: esp-cpp/StaticAnalysis@master
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ 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/package_main.yml](./.github/workflows/package_main.yml) file
to:
- have the correct target architecture (e.g. `esp32s3`) for your project
Expand Down
1 change: 1 addition & 0 deletions main/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <atomic>
#include <chrono>
#include <thread>

Expand Down
Loading