diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 16fec05..a548ae6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: @@ -19,6 +43,8 @@ jobs: - name: Install ESP-IDF uses: ./ + with: + eim-version: "v0.2.6" - name: Verify Installation run: | diff --git a/README.md b/README.md index ba682ca..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 @@ -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 @@ -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 @@ -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 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..b5380df 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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"; @@ -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 @@ -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 d039c5d..757a52e 100644 --- a/index.js +++ b/index.js @@ -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"; @@ -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 @@ -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