├── .github └── workflows │ ├── issue_comment.yml │ ├── new_issues.yml │ └── new_prs.yml ├── LICENSE ├── README.md └── action.yml /.github/workflows/issue_comment.yml: -------------------------------------------------------------------------------- 1 | name: Sync issue comments to JIRA 2 | 3 | # This workflow will be triggered when new issue comment is created (including PR comments) 4 | on: issue_comment 5 | 6 | jobs: 7 | sync_issue_comments_to_jira: 8 | name: Sync Issue Comments to Jira 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@master 12 | - name: Sync issue comments to JIRA 13 | uses: espressif/github-actions/sync_issues_to_jira@master 14 | env: 15 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 16 | JIRA_PASS: ${{ secrets.JIRA_PASS }} 17 | JIRA_PROJECT: RDT 18 | JIRA_COMPONENT: GitHub 19 | JIRA_URL: ${{ secrets.JIRA_URL }} 20 | JIRA_USER: ${{ secrets.JIRA_USER }} 21 | -------------------------------------------------------------------------------- /.github/workflows/new_issues.yml: -------------------------------------------------------------------------------- 1 | name: Sync issues to Jira 2 | 3 | # This workflow will be triggered when a new issue is opened 4 | on: issues 5 | 6 | jobs: 7 | sync_issues_to_jira: 8 | name: Sync issues to Jira 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@master 12 | - name: Sync GitHub issues to Jira project 13 | uses: espressif/github-actions/sync_issues_to_jira@master 14 | env: 15 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 16 | JIRA_PASS: ${{ secrets.JIRA_PASS }} 17 | JIRA_PROJECT: RDT 18 | JIRA_COMPONENT: GitHub 19 | JIRA_URL: ${{ secrets.JIRA_URL }} 20 | JIRA_USER: ${{ secrets.JIRA_USER }} 21 | -------------------------------------------------------------------------------- /.github/workflows/new_prs.yml: -------------------------------------------------------------------------------- 1 | name: Sync remain PRs to Jira 2 | 3 | # This workflow will be triggered every hour, to sync remaining PRs (i.e. PRs with zero comment) to Jira project 4 | # Note that, PRs can also get synced when new PR comment is created 5 | on: 6 | schedule: 7 | - cron: "0 * * * *" 8 | 9 | jobs: 10 | sync_prs_to_jira: 11 | name: Sync PRs to Jira 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@master 15 | - name: Sync PRs to Jira project 16 | uses: espressif/github-actions/sync_issues_to_jira@master 17 | with: 18 | cron_job: true 19 | env: 20 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 21 | JIRA_PASS: ${{ secrets.JIRA_PASS }} 22 | JIRA_PROJECT: RDT 23 | JIRA_COMPONENT: GitHub 24 | JIRA_URL: ${{ secrets.JIRA_URL }} 25 | JIRA_USER: ${{ secrets.JIRA_USER }} 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Espressif Systems (Shanghai) CO LTD 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # esp-idf-ci-action 2 | 3 | This GitHub action helps to build ESP-IDF projects for the Espressif ESP32 family of chips. 4 | 5 | Under the hood, it wraps the official [ESP-IDF docker image](https://hub.docker.com/r/espressif/idf) and uses Docker to execute ESP-IDF commands within a containerized environment. Therefore, it must run on a runner that supports Linux Docker containers. We recommend using `ubuntu-latest` on GitHub-hosted runner. 6 | 7 | ## Usage 8 | 9 | An example workflow to build an ESP-IDF project: 10 | 11 | ``` 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - name: Checkout repo 18 | uses: actions/checkout@v4 19 | with: 20 | submodules: 'recursive' 21 | - name: esp-idf build 22 | uses: espressif/esp-idf-ci-action@v1 23 | with: 24 | esp_idf_version: v4.4 25 | target: esp32s2 26 | path: 'esp32-s2-hmi-devkit-1/examples/smart-panel' 27 | ``` 28 | 29 | ## Version 30 | 31 | We recommend referencing this action as `espressif/esp-idf-ci-action@v1` and using `v1` instead of `main` to avoid breaking your workflows. `v1` tag always points to the latest compatible release. 32 | 33 | ## Parameters 34 | 35 | ### `path` 36 | 37 | Path to the project to be built relative to the root of your repository. 38 | 39 | ### `esp_idf_version` 40 | 41 | The version of ESP-IDF for the action. Default value `latest`. 42 | 43 | It must be one of the tags from Docker Hub: https://hub.docker.com/r/espressif/idf/tags 44 | 45 | More information about supported versions of ESP-IDF: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/versions.html#support-periods 46 | 47 | ### `esp_idf_docker_image` 48 | 49 | The base image for the docker container to run. Default value `espressif/idf` 50 | 51 | If using a modified or self-hosted version of the IDF. The `esp_idf_version` will still be used to specify the tag of the docker image, so setting both can be used to directly specify which docker image to use. 52 | 53 | ### `extra_docker_args` 54 | 55 | Additional parameters to pass to the docker run command. Default value is no additional command (empty). 56 | 57 | The argument is passed directly to the docke run command, just before the specification of the docker image. 58 | 59 | Can be used to add additional volumes and environment variables to the container, like having a ccache directory to speed up recompilation (needs ccache to be installed in the specified docker image and make sure to have ccache folder available on host device). Example: 60 | 61 | ```yaml 62 | extra_docker_args: -v ./.ccache:/root/.ccache -e CCACHE_DIR=/root/.ccache 63 | ``` 64 | 65 | More information about parameters for docker run: https://docs.docker.com/reference/cli/docker/container/run/ 66 | 67 | ### `target` 68 | 69 | Type of ESP32 to build for. Default value `esp32`. 70 | 71 | 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 72 | 73 | ### `command` 74 | 75 | Optional: Specify the command that will run as part of this GitHub build step. 76 | 77 | Default: `idf.py build` 78 | 79 | Overriding this is useful for running other commands via github actions. Example: 80 | 81 | ```yaml 82 | command: esptool.py merge_bin -o ../your_final_output.bin @flash_args 83 | ``` 84 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: "Espressif IoT Development Framework (ESP-IDF)" 2 | description: "This action builds your firmware for ESP32 directly in GitHub using Espressif ESP-IDF Docker image." 3 | branding: 4 | color: red 5 | icon: wifi 6 | inputs: 7 | path: 8 | description: "Relative path under $GITHUB_WORKSPACE to place the repository" 9 | default: "" 10 | required: false 11 | esp_idf_version: 12 | description: "Version of ESP-IDF docker image to use" 13 | default: "latest" 14 | required: false 15 | esp_idf_docker_image: 16 | description: "Docker Repository to obtain the ESP-IDF image from" 17 | default: "espressif/idf" 18 | required: false 19 | extra_docker_args: 20 | description: "Additional arguments to pass to the docker run command" 21 | default: "" 22 | required: false 23 | target: 24 | description: "ESP32 variant to build for" 25 | default: "esp32" 26 | required: false 27 | command: 28 | description: "Command to run inside the docker container (default: builds the project)" 29 | default: "idf.py build" 30 | required: false 31 | 32 | runs: 33 | using: "composite" 34 | steps: 35 | - run: | 36 | export IDF_TARGET=$(echo "${{ inputs.target }}" | tr '[:upper:]' '[:lower:]' | tr -d '_-') 37 | docker run -t \ 38 | -e IDF_TARGET="${IDF_TARGET}" \ 39 | -v "${GITHUB_WORKSPACE}:/app/${{ github.repository }}" \ 40 | -w "/app/${{ github.repository }}/${{ inputs.path }}" \ 41 | ${{ inputs.extra_docker_args }} \ 42 | ${{ inputs.esp_idf_docker_image }}:${{ inputs.esp_idf_version }} \ 43 | /bin/bash -c 'git config --global --add safe.directory "*" && ${{ inputs.command }}' 44 | shell: bash 45 | --------------------------------------------------------------------------------