Skip to content

Commit d70b3f0

Browse files
authored
enabled use of fixed EIM version (#8)
* enabled use of fixed EIM version * added scheduled run of test every day * added new prerequisites * updated README.md --------- Co-authored-by: Petr Gadorek <[email protected]>
1 parent 1d1847b commit d70b3f0

File tree

5 files changed

+66
-14
lines changed

5 files changed

+66
-14
lines changed

.github/workflows/test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,33 @@ on:
55
branches: [v1]
66
pull_request:
77
branches: [v1]
8+
schedule:
9+
- cron: '20 4 * * 2'
810

911
jobs:
1012
test:
13+
name: Test on ${{ matrix.os }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest, macos-latest, windows-latest]
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Install ESP-IDF
23+
uses: ./
24+
25+
- name: Verify Installation
26+
run: |
27+
echo "Verifying ESP-IDF installation..."
28+
echo "ESP-IDF Path: $IDF_PATH"
29+
echo "ESP-IDF Tools Path: $IDF_TOOLS_PATH"
30+
echo "ESP-IDF Python Environment Path: $IDF_PYTHON_ENV_PATH"
31+
echo "ESP-IDF Version:"
32+
idf.py --version
33+
34+
fixed-version-test:
1135
name: Test on ${{ matrix.os }}
1236
runs-on: ${{ matrix.os }}
1337
strategy:
@@ -19,6 +43,8 @@ jobs:
1943

2044
- name: Install ESP-IDF
2145
uses: ./
46+
with:
47+
eim-version: "v0.2.6"
2248

2349
- name: Verify Installation
2450
run: |

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ESP-IDF Installation Action
22

33
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.
4-
If you just need to build the project, you can use [esp-idf-ci-action](https://github.com/espressif/esp-idf-ci-action).
4+
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).
55

66
## Features
77

@@ -45,6 +45,7 @@ steps:
4545
| `version` | Version of ESP-IDF to install | Latest released version |
4646
| `path` | Installation path for ESP-IDF | `/opt/esp/idf` (POSIX) or `C:\esp\idf` (Windows) |
4747
| `tools-path` | Path for ESP-IDF tools | `/opt/esp` (POSIX) or `C:\esp` (Windows) |
48+
| `eim-version` | Version of EIM to use | Latest released version |
4849

4950
## Available Commands
5051

@@ -97,12 +98,12 @@ jobs:
9798
### Linux
9899

99100
- Automatically installs required packages using apt-get
100-
- Default installation path: `/opt/esp/idf`
101+
- Default installation path: `/tmp/esp/idf`
101102

102103
### macOS
103104

104105
- Automatically installs required packages using Homebrew
105-
- Default installation path: `/opt/esp/idf`
106+
- Default installation path: `~/esp/idf`
106107

107108
### Windows
108109

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

198199
- [Espressif Systems](https://www.espressif.com/) for ESP-IDF
199-
- [cli-idf-installer](https://github.com/espressif/idf-im-cli) for the installation tools
200+
- [EIM](https://github.com/espressif/idf-im-ui/) for the installation tools

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ inputs:
1313
tools-path:
1414
description: "Path for ESP-IDF tools"
1515
required: false
16+
eim-version:
17+
description: "Version of EIM to use (default is latest)"
18+
required: false
1619

1720
runs:
1821
using: "node20"

dist/index.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30230,10 +30230,21 @@ async function run() {
3023030230
const version = core.getInput("version");
3023130231
let idfPath = core.getInput("path");
3023230232
let toolsPath = core.getInput("tools-path");
30233+
const eimVersionInput = core.getInput("eim-version");
3023330234

3023430235
// Set default paths if not provided
3023530236
if (!idfPath) {
30236-
idfPath = process.platform === "win32" ? "C:\\esp\\idf" : "/tmp/esp/idf";
30237+
switch (process.platform) {
30238+
case "darwin":
30239+
idfPath = "~/esp/idf";
30240+
break;
30241+
case "win32":
30242+
idfPath = "C:\\esp\\idf";
30243+
break;
30244+
default:
30245+
idfPath = "/tmp/esp/idf";
30246+
break;
30247+
}
3023730248
}
3023830249
if (!toolsPath) {
3023930250
toolsPath = process.platform === "win32" ? "C:\\esp" : "/tmp/esp";
@@ -30242,8 +30253,7 @@ async function run() {
3024230253
// Install platform-specific dependencies
3024330254
await installDependencies(process.platform);
3024430255

30245-
// Get latest EIM version from GitHub
30246-
const eimVersion = await getLatestEimVersion();
30256+
const eimVersion = eimVersionInput || (await getLatestEimVersion());
3024730257
core.info(`Using EIM version: ${eimVersion}`);
3024830258

3024930259
// Get the appropriate EIM download URL
@@ -30382,6 +30392,7 @@ async function run() {
3038230392
} else {
3038330393
// Create shell script for Unix
3038430394
const shContent = `#!/bin/bash\n${fullPath} "$@"`;
30395+
core.info(`Creating wrapper script for ${cmd} at ${wrapperPath}`);
3038530396
await fs.promises.writeFile(wrapperPath, shContent);
3038630397
await exec.exec("chmod", ["+x", wrapperPath]);
3038730398
}
@@ -30476,11 +30487,11 @@ async function installDependencies(platform) {
3047630487
}
3047730488
await exec.exec("sudo apt-get update");
3047830489
await exec.exec(
30479-
"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"
30490+
"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"
3048030491
);
3048130492
break;
3048230493
case "darwin":
30483-
await exec.exec("brew install dfu-util cmake ninja");
30494+
await exec.exec("brew install dfu-util cmake ninja libgcrypt glib pixman sdl2 libslirp");
3048430495
break;
3048530496
case "win32":
3048630497
// No dependencies needed for Windows

index.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,21 @@ async function run() {
5858
const version = core.getInput("version");
5959
let idfPath = core.getInput("path");
6060
let toolsPath = core.getInput("tools-path");
61+
const eimVersionInput = core.getInput("eim-version");
6162

6263
// Set default paths if not provided
6364
if (!idfPath) {
64-
idfPath = process.platform === "win32" ? "C:\\esp\\idf" : "/tmp/esp/idf";
65+
switch (process.platform) {
66+
case "darwin":
67+
idfPath = "~/esp/idf";
68+
break;
69+
case "win32":
70+
idfPath = "C:\\esp\\idf";
71+
break;
72+
default:
73+
idfPath = "/tmp/esp/idf";
74+
break;
75+
}
6576
}
6677
if (!toolsPath) {
6778
toolsPath = process.platform === "win32" ? "C:\\esp" : "/tmp/esp";
@@ -70,8 +81,7 @@ async function run() {
7081
// Install platform-specific dependencies
7182
await installDependencies(process.platform);
7283

73-
// Get latest EIM version from GitHub
74-
const eimVersion = await getLatestEimVersion();
84+
const eimVersion = eimVersionInput || (await getLatestEimVersion());
7585
core.info(`Using EIM version: ${eimVersion}`);
7686

7787
// Get the appropriate EIM download URL
@@ -210,6 +220,7 @@ async function run() {
210220
} else {
211221
// Create shell script for Unix
212222
const shContent = `#!/bin/bash\n${fullPath} "$@"`;
223+
core.info(`Creating wrapper script for ${cmd} at ${wrapperPath}`);
213224
await fs.promises.writeFile(wrapperPath, shContent);
214225
await exec.exec("chmod", ["+x", wrapperPath]);
215226
}
@@ -304,11 +315,11 @@ async function installDependencies(platform) {
304315
}
305316
await exec.exec("sudo apt-get update");
306317
await exec.exec(
307-
"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"
318+
"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"
308319
);
309320
break;
310321
case "darwin":
311-
await exec.exec("brew install dfu-util cmake ninja");
322+
await exec.exec("brew install dfu-util cmake ninja libgcrypt glib pixman sdl2 libslirp");
312323
break;
313324
case "win32":
314325
// No dependencies needed for Windows

0 commit comments

Comments
 (0)