From fed2c1eef44d47fff6af06859006dce027507298 Mon Sep 17 00:00:00 2001 From: Petr Gadorek Date: Mon, 21 Jul 2025 09:32:25 +0200 Subject: [PATCH 1/5] enabled use of fixed EIM version --- .github/workflows/test.yml | 19 +++++++++++++++++++ README.md | 1 + action.yml | 3 +++ dist/index.js | 4 ++-- index.js | 4 ++-- 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 16fec05..7834805 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,3 +23,22 @@ jobs: - name: Verify Installation run: | idf.py --version + + fixed-version-test: + name: Test on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, macos-13, windows-latest] + + steps: + - uses: actions/checkout@v4 + + - name: Install ESP-IDF + uses: ./ + with: + eim-version: "v0.2.6" + + - name: Verify Installation + run: | + idf.py --version diff --git a/README.md b/README.md index ba682ca..7985a9a 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/action.yml b/action.yml index 47e3ee7..3488a08 100644 --- a/action.yml +++ b/action.yml @@ -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" diff --git a/dist/index.js b/dist/index.js index 0d6ef52..97c30fa 100644 --- a/dist/index.js +++ b/dist/index.js @@ -30230,6 +30230,7 @@ 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) { @@ -30242,8 +30243,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 diff --git a/index.js b/index.js index d039c5d..d1d4cf2 100644 --- a/index.js +++ b/index.js @@ -58,6 +58,7 @@ 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) { @@ -70,8 +71,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 From 1ea435d1ef88918cda0d1c55e8ef7eaa5dbafd8e Mon Sep 17 00:00:00 2001 From: Petr Gadorek Date: Mon, 21 Jul 2025 09:48:33 +0200 Subject: [PATCH 2/5] added scheduled run of test every day --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7834805..3bb78eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,6 +5,8 @@ on: branches: [v1] pull_request: branches: [v1] + schedule: + - cron: '20 4 * * *' jobs: test: From 158fbf0c1857c8865a77208177c323129ec87114 Mon Sep 17 00:00:00 2001 From: Petr Gadorek Date: Mon, 21 Jul 2025 09:50:28 +0200 Subject: [PATCH 3/5] added new prerequisities --- .github/workflows/test.yml | 5 +++++ dist/index.js | 17 ++++++++++++++--- index.js | 17 ++++++++++++++--- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3bb78eb..404c771 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,6 +24,11 @@ jobs: - 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: diff --git a/dist/index.js b/dist/index.js index 97c30fa..b5380df 100644 --- a/dist/index.js +++ b/dist/index.js @@ -30234,7 +30234,17 @@ async function run() { // 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"; @@ -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]); } @@ -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 diff --git a/index.js b/index.js index d1d4cf2..757a52e 100644 --- a/index.js +++ b/index.js @@ -62,7 +62,17 @@ async function run() { // 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"; @@ -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]); } @@ -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 From a5ab94e8c6702d8a12e32393c740008d1aae4028 Mon Sep 17 00:00:00 2001 From: Petr Gadorek Date: Wed, 23 Jul 2025 09:33:58 +0200 Subject: [PATCH 4/5] updated README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7985a9a..c0ff528 100644 --- a/README.md +++ b/README.md @@ -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 @@ -98,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 @@ -197,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 From 4bfaf6cab654f634496f339001cc96ffe5e1966c Mon Sep 17 00:00:00 2001 From: Petr Gadorek Date: Thu, 24 Jul 2025 11:58:59 +0200 Subject: [PATCH 5/5] pr fixes applied --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 404c771..a548ae6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: pull_request: branches: [v1] schedule: - - cron: '20 4 * * *' + - cron: '20 4 * * 2' jobs: test: @@ -14,7 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest, macos-13, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@v4