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
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,33 @@ on:
branches: [v1]
pull_request:
branches: [v1]
schedule:
- cron: '20 4 * * 2'

jobs:
test:
name: Test 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: ./

- name: Verify Installation
run: |
echo "Verifying ESP-IDF installation..."
echo "ESP-IDF Path: $IDF_PATH"
echo "ESP-IDF Tools Path: $IDF_TOOLS_PATH"
echo "ESP-IDF Python Environment Path: $IDF_PYTHON_ENV_PATH"
echo "ESP-IDF Version:"
idf.py --version

fixed-version-test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -19,6 +43,8 @@ jobs:

- name: Install ESP-IDF
uses: ./
with:
eim-version: "v0.2.6"

- name: Verify Installation
run: |
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ESP-IDF Installation Action

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](https://github.com/espressif/esp-idf-ci-action).
If you just need to build the project, you can use [esp-idf-ci-action](https://github.com/espressif/esp-idf-ci-action). You can also use docker based solution as suggested in the [installer documentetion](https://docs.espressif.com/projects/idf-im-ui/en/latest/headless_usage.html#docker-integration).

## Features

Expand Down Expand Up @@ -45,6 +45,7 @@ steps:
| `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 |

## Available Commands

Expand Down Expand Up @@ -97,12 +98,12 @@ jobs:
### Linux

- Automatically installs required packages using apt-get
- Default installation path: `/opt/esp/idf`
- Default installation path: `/tmp/esp/idf`

### macOS

- Automatically installs required packages using Homebrew
- Default installation path: `/opt/esp/idf`
- Default installation path: `~/esp/idf`

### Windows

Expand Down Expand Up @@ -196,4 +197,4 @@ This project is licensed under the MIT License - see the LICENSE file for detail
## Acknowledgments

- [Espressif Systems](https://www.espressif.com/) for ESP-IDF
- [cli-idf-installer](https://github.com/espressif/idf-im-cli) for the installation tools
- [EIM](https://github.com/espressif/idf-im-ui/) for the installation tools
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ inputs:
tools-path:
description: "Path for ESP-IDF tools"
required: false
eim-version:
description: "Version of EIM to use (default is latest)"
required: false

runs:
using: "node20"
Expand Down
21 changes: 16 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30230,10 +30230,21 @@ async function run() {
const version = core.getInput("version");
let idfPath = core.getInput("path");
let toolsPath = core.getInput("tools-path");
const eimVersionInput = core.getInput("eim-version");

// Set default paths if not provided
if (!idfPath) {
idfPath = process.platform === "win32" ? "C:\\esp\\idf" : "/tmp/esp/idf";
switch (process.platform) {
case "darwin":
idfPath = "~/esp/idf";
break;
case "win32":
idfPath = "C:\\esp\\idf";
break;
default:
idfPath = "/tmp/esp/idf";
break;
}
}
if (!toolsPath) {
toolsPath = process.platform === "win32" ? "C:\\esp" : "/tmp/esp";
Expand All @@ -30242,8 +30253,7 @@ async function run() {
// Install platform-specific dependencies
await installDependencies(process.platform);

// Get latest EIM version from GitHub
const eimVersion = await getLatestEimVersion();
const eimVersion = eimVersionInput || (await getLatestEimVersion());
core.info(`Using EIM version: ${eimVersion}`);

// Get the appropriate EIM download URL
Expand Down Expand Up @@ -30382,6 +30392,7 @@ async function run() {
} else {
// Create shell script for Unix
const shContent = `#!/bin/bash\n${fullPath} "$@"`;
core.info(`Creating wrapper script for ${cmd} at ${wrapperPath}`);
await fs.promises.writeFile(wrapperPath, shContent);
await exec.exec("chmod", ["+x", wrapperPath]);
}
Expand Down Expand Up @@ -30476,11 +30487,11 @@ async function installDependencies(platform) {
}
await exec.exec("sudo apt-get update");
await exec.exec(
"sudo apt-get install -y git cmake ninja-build wget flex bison gperf ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 python3 python3-pip python3-setuptools python3-wheel xz-utils unzip python3-venv"
"sudo apt-get install -y git cmake ninja-build wget flex bison gperf ccache libgcrypt20 libglib2.0-0 libpixman-1-0 libsdl2-2.0-0 libslirp0 libffi-dev libssl-dev dfu-util libusb-1.0-0 python3 python3-pip python3-setuptools python3-wheel xz-utils unzip python3-venv"
);
break;
case "darwin":
await exec.exec("brew install dfu-util cmake ninja");
await exec.exec("brew install dfu-util cmake ninja libgcrypt glib pixman sdl2 libslirp");
break;
case "win32":
// No dependencies needed for Windows
Expand Down
21 changes: 16 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,21 @@ async function run() {
const version = core.getInput("version");
let idfPath = core.getInput("path");
let toolsPath = core.getInput("tools-path");
const eimVersionInput = core.getInput("eim-version");

// Set default paths if not provided
if (!idfPath) {
idfPath = process.platform === "win32" ? "C:\\esp\\idf" : "/tmp/esp/idf";
switch (process.platform) {
case "darwin":
idfPath = "~/esp/idf";
break;
case "win32":
idfPath = "C:\\esp\\idf";
break;
default:
idfPath = "/tmp/esp/idf";
break;
}
}
if (!toolsPath) {
toolsPath = process.platform === "win32" ? "C:\\esp" : "/tmp/esp";
Expand All @@ -70,8 +81,7 @@ async function run() {
// Install platform-specific dependencies
await installDependencies(process.platform);

// Get latest EIM version from GitHub
const eimVersion = await getLatestEimVersion();
const eimVersion = eimVersionInput || (await getLatestEimVersion());
core.info(`Using EIM version: ${eimVersion}`);

// Get the appropriate EIM download URL
Expand Down Expand Up @@ -210,6 +220,7 @@ async function run() {
} else {
// Create shell script for Unix
const shContent = `#!/bin/bash\n${fullPath} "$@"`;
core.info(`Creating wrapper script for ${cmd} at ${wrapperPath}`);
await fs.promises.writeFile(wrapperPath, shContent);
await exec.exec("chmod", ["+x", wrapperPath]);
}
Expand Down Expand Up @@ -304,11 +315,11 @@ async function installDependencies(platform) {
}
await exec.exec("sudo apt-get update");
await exec.exec(
"sudo apt-get install -y git cmake ninja-build wget flex bison gperf ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 python3 python3-pip python3-setuptools python3-wheel xz-utils unzip python3-venv"
"sudo apt-get install -y git cmake ninja-build wget flex bison gperf ccache libgcrypt20 libglib2.0-0 libpixman-1-0 libsdl2-2.0-0 libslirp0 libffi-dev libssl-dev dfu-util libusb-1.0-0 python3 python3-pip python3-setuptools python3-wheel xz-utils unzip python3-venv"
);
break;
case "darwin":
await exec.exec("brew install dfu-util cmake ninja");
await exec.exec("brew install dfu-util cmake ninja libgcrypt glib pixman sdl2 libslirp");
break;
case "win32":
// No dependencies needed for Windows
Expand Down
Loading