Skip to content

Commit 4346134

Browse files
authored
add new parameter 'action' (#15)
* add new parameter 'command' - allows overriding the actual command executed in the container - useful for running other build commands besides 'idf.py build' - example: generating custom flash images, or using other SDK tools
1 parent 0ab4167 commit 4346134

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,15 @@ More information about supported versions of ESP-IDF: https://docs.espressif.com
4444
Type of ESP32 to build for. Default value `esp32`.
4545

4646
The value must be one of the supported ESP-IDF targets as documented here: https://github.com/espressif/esp-idf#esp-idf-release-and-soc-compatibility
47+
48+
### `command`
49+
50+
Optional: Specify the command that will run as part of this GitHub build step.
51+
52+
Default: `idf.py build`
53+
54+
Overriding this is useful for running other commands via github actions. Example:
55+
56+
```yaml
57+
command: esptool.py merge_bin -o ../your_final_output.bin @flash_args
58+
```

action.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: "Espressif IoT Development Framework (ESP-IDF)"
2-
description: "This action build your firmware for ESP32 directly in GitHub using Espressif ESP-IDF Docker image."
2+
description: "This action builds your firmware for ESP32 directly in GitHub using Espressif ESP-IDF Docker image."
33
branding:
44
color: red
55
icon: wifi
@@ -16,11 +16,15 @@ inputs:
1616
description: 'ESP32 variant to build for'
1717
default: 'esp32'
1818
required: false
19+
command:
20+
description: 'Command to run inside the docker container (default: builds the project)'
21+
default: 'idf.py build'
22+
required: false
1923

2024
runs:
2125
using: "composite"
2226
steps:
2327
- run: |
2428
export IDF_TARGET=$(echo "${{ inputs.target }}" | tr '[:upper:]' '[:lower:]' | tr -d '_-')
25-
docker run -t -e IDF_TARGET="${IDF_TARGET}" -v "${GITHUB_WORKSPACE}:/app" -w "/app/${{ inputs.path }}" espressif/idf:${{ inputs.esp_idf_version }} idf.py build
29+
docker run -t -e IDF_TARGET="${IDF_TARGET}" -v "${GITHUB_WORKSPACE}:/app" -w "/app/${{ inputs.path }}" espressif/idf:${{ inputs.esp_idf_version }} ${{ inputs.command }}
2630
shell: bash

0 commit comments

Comments
 (0)