This GitHub Action automates the installation of the ESP-IDF framework on GitHub-hosted runners. It supports Windows, macOS (arm64 and Intel), and Linux (arm64 and x64) platforms, allowing you to set up ESP-IDF for your CI/CD workflows. If you just need to build the project, you can use esp-idf-ci-action. You can also use docker based solution as suggested in the installer documentetion.
- Cross-platform support (Windows, macOS, Linux) thanks to EIM
- Automatic installation of required system dependencies
- Configurable ESP-IDF version and installation paths
- Sets up all necessary environment variables and tools
- Adds ESP-IDF commands (
idf.py,esptool.py, etc.) to PATH
Basic usage with default settings:
steps:
- uses: actions/checkout@v4
- name: Install ESP-IDF
uses: espressif/install-esp-idf-action@v1
- name: Build your project
run: |
idf.py buildAdvanced usage with custom configuration:
steps:
- uses: actions/checkout@v4
- name: Install ESP-IDF
uses: espressif/install-esp-idf-action@v1
with:
version: "v5.0"
path: "/custom/path/to/esp-idf"
tools-path: "/custom/path/to/tools"| Input | Description | Default |
|---|---|---|
version |
Version of ESP-IDF to install | Latest released version |
path |
Installation path for ESP-IDF | /opt/esp/idf (POSIX) or C:\esp\idf (Windows) |
tools-path |
Path for ESP-IDF tools | /opt/esp (POSIX) or C:\esp (Windows) |
eim-version |
Version of EIM to use | Latest released version |
After installation, the following commands are available in your workflow:
idf.py- Main ESP-IDF tool for project managementesptool.py- Utility for flashing ESP chipsespefuse.py- Utility for ESP chip eFuse managementespsecure.py- Utility for ESP security featuresotatool.py- Utility for ESP OTA operationsparttool.py- Utility for flash partitions operations
Here's a complete example showing how to use this action in a workflow:
name: ESP-IDF Build
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Install ESP-IDF
uses: espressif/install-esp-idf-action@v1
with:
version: "v5.0"
- name: Build Project
run: |
idf.py set-target esp32
idf.py build- Automatically installs required packages using apt-get
- Default installation path:
/tmp/esp/idf
- Automatically installs required packages using Homebrew
- Default installation path:
~/esp/idf
- No additional dependencies required
- Default installation path:
C:\esp\idf
- Make sure to use PowerShell when running commands
- Some commands might require elevated privileges
- Some operations might require sudo privileges
- Ensure Homebrew (macOS) is installed for dependency management
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Clone the repository:
git clone https://github.com/your-username/install-esp-idf-action.git
cd install-esp-idf-action- Install dependencies:
npm install- Install development tool for bundling:
npm install -g @vercel/ncc-
Make your changes to the action code in
index.js. -
Build the action:
ncc build index.js --license licenses.txtThis will create a single file in dist/index.js containing all the bundled code.
- Commit both your source changes and the built
distdirectory:
git add .
git commit -m "your changes"
git push origin your-branchThe GitHub Actions workflow will automatically test your changes on all supported platforms.
action.yml- Action metadata fileindex.js- Main action source codedist/- Compiled action code (must be committed).github/workflows/- Test workflows
- Update version in
package.jsonif needed - Build the action:
ncc build index.js --license licenses.txt- Commit all changes including the
distdirectory - Create and push a new tag:
git push origin v1This project is licensed under the MIT License - see the LICENSE file for details.
- Espressif Systems for ESP-IDF
- EIM for the installation tools