diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 48e4f02..394674e 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -17,7 +17,7 @@ jobs: - run: ls -la ${GITHUB_WORKSPACE}/code - run: find ${GITHUB_WORKSPACE}/code -maxdepth 2 -name CMakeLists.txt - name: esp-idf build - uses: espressif/esp-idf-ci-action@v1.2.0 + uses: $/esp-idf-ci-action with: esp_idf_version: v6.0.2 target: esp32c6 diff --git a/.gitea/workflows/esp-idf-ci-action.yaml b/.gitea/workflows/esp-idf-ci-action.yaml new file mode 100644 index 0000000..f768dcf --- /dev/null +++ b/.gitea/workflows/esp-idf-ci-action.yaml @@ -0,0 +1,44 @@ +name: "Espressif IoT Development Framework (ESP-IDF)" +description: "This action builds your firmware for ESP32 directly in GitHub using Espressif ESP-IDF Docker image." +branding: + color: red + icon: wifi +inputs: + path: + description: "Relative path under $GITHUB_WORKSPACE to place the repository" + default: "" + required: false + esp_idf_version: + description: "Version of ESP-IDF docker image to use" + default: "latest" + required: false + esp_idf_docker_image: + description: "Docker Repository to obtain the ESP-IDF image from" + default: "espressif/idf" + required: false + extra_docker_args: + description: "Additional arguments to pass to the docker run command" + default: "" + required: false + target: + description: "ESP32 variant to build for" + default: "esp32" + required: false + command: + description: "Command to run inside the docker container (default: builds the project)" + default: "idf.py build" + required: false + +runs: + using: "composite" + steps: + - run: | + export IDF_TARGET=$(echo "${{ inputs.target }}" | tr '[:upper:]' '[:lower:]' | tr -d '_-') + docker run -t \ + -e IDF_TARGET="${IDF_TARGET}" \ + -v ${GITHUB_WORKSPACE}:/app/${{ github.repository }} \ + -w /app/${{ github.repository }}/${{ inputs.path }} \ + ${{ inputs.extra_docker_args }} \ + ${{ inputs.esp_idf_docker_image }}:${{ inputs.esp_idf_version }} \ + /bin/bash -c 'git config --global --add safe.directory "*" && ${{ inputs.command }}' + shell: bash \ No newline at end of file