diff --git a/README.md b/README.md index 2ffc955..eb2a3d6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# ESP32 build - ESP-IDF v4.x +# ESP-IDF v4.x installer -GitHub Action to build your ESP32 code with Espressif IoT Development Framework v4.x +GitHub Action to install Espressif IoT Development Framework v4.x for building ESP32 code. The usable ESP-IDF versions are: @@ -13,8 +13,17 @@ The usable ESP-IDF versions are: ## Usage +Source the ESP-IDF required environment variables before building your code: + +```sh +source ~/esp/esp-idf/export.sh +idf.py build +``` + It is used at least in [ESP32HAL](https://github.com/CalinRadoni/ESP32HAL) repository. +### Example + ```yml name: ESP32 Builder @@ -22,24 +31,32 @@ on: [push] jobs: builder: - name: Builder for test project + name: Builder for test ESP32 project runs-on: ubuntu-20.04 steps: - name: Checkout code uses: actions/checkout@v2 - - name: Build - uses: CalinRadoni/esp-idf-v4-action@v1 + - name: Install ESP-IDF + uses: CalinRadoni/esp-idf-v4-action@v2 with: esp_idf_version: 'v4.1' - src_directory: '.' + + - name: Build + run: | + source ~/esp/esp-idf/export.sh + idf.py reconfigure + idf.py app + idf.py size ``` ## About It was tested in the official Ubuntu Focal Docker container and it contains some minor extra steps not really needed for the GitHub-hosted Ubuntu 20.04 LTS runner, like the installation of `tzdata` and `python3-libusb1`. I left them for completeness if more tests are needed. +Version 2 of this action does not build the ESP32 code, like version 1 has done it, to allow custom build steps. + ## License This repository is licensed with the [MIT License](LICENSE). diff --git a/action.yml b/action.yml index 93c9448..5b1aa28 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ -name: 'ESP32 build - ESP-IDF v4' -description: 'GitHub Action to build your ESP32 code with Espressif IoT Development Framework v4.x' +name: 'ESP-IDF v4.x installer' +description: 'GitHub Action to install Espressif IoT Development Framework v4.x for building ESP32 code.' branding: icon: check @@ -10,19 +10,9 @@ inputs: description: 'Required ESP-IDF version (v4.1, release/v4.2, ...)' required: false default: 'v4.1' - src_directory: - description: 'The directory with source code' - required: false - default: '.' - idf_reconfigure: - description: 'Run the `idf.py reconfigure` command' - required: false - default: 'true' runs: using: "composite" steps: - run: ${{ github.action_path }}/install.sh ${{ inputs.esp_idf_version }} shell: bash - - run: ${{ github.action_path }}/build.sh ${{ inputs.esp_idf_version }} ${{ inputs.src_directory }} ${{ inputs.idf_reconfigure }} - shell: bash diff --git a/build.sh b/build.sh deleted file mode 100755 index e2aee8e..0000000 --- a/build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -source ~/esp/esp-idf/export.sh - -esp_idf_version="$1" -src_directory="$2" -idf_reconfigure="$3" - -cd "$src_directory" - -if [[ "$idf_reconfigure" == "true" ]]; then - echo -e "\n\n## Reconfigure the project" - idf.py reconfigure -fi - -echo -e "\n\n## Build the app" -idf.py app - -echo -e "\n\n## Show sizes" -idf.py size -