summaryrefslogtreecommitdiff
path: root/.github/actions/setup_toolchain/espressif
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2024-05-13 16:41:11 +0700
committerGitHub <[email protected]>2024-05-13 16:41:11 +0700
commit6f47746e5ff6e33b25e12742d62bcbf69f8a27a0 (patch)
treee4892f86e7bc788b31732971f4017513c310ed49 /.github/actions/setup_toolchain/espressif
parentd707ea56b47e2fbbe5eaa4854a427a3a7873dea3 (diff)
more ci update (#2642)
* Circi use small docker * caching espressif docker image * only run make job on pull request or push to master * hw test run on pull request only, rename build_cmake to build.yml * enable all ci build, cmake(clang) and make(*) only run with pull_request or push to master
Diffstat (limited to '.github/actions/setup_toolchain/espressif')
-rw-r--r--.github/actions/setup_toolchain/espressif/action.yml42
1 files changed, 42 insertions, 0 deletions
diff --git a/.github/actions/setup_toolchain/espressif/action.yml b/.github/actions/setup_toolchain/espressif/action.yml
new file mode 100644
index 000000000..a4c6127c6
--- /dev/null
+++ b/.github/actions/setup_toolchain/espressif/action.yml
@@ -0,0 +1,42 @@
+name: Setup ESP-IDF Toolchain
+
+inputs:
+ toolchain:
+ description: 'Toolchain name'
+ required: true
+ toolchain_url:
+ description: 'Toolchain URL or version'
+ required: true
+
+runs:
+ using: "composite"
+ steps:
+ - id: set-docker-image
+ run: |
+ DOCKER_IMAGE=$HOME/cache/${{ inputs.toolchain }}/docker_image.tar
+ echo "DOCKER_IMAGE=$DOCKER_IMAGE" >> $GITHUB_ENV
+ echo "DOCKER_IMAGE=$DOCKER_IMAGE" >> $GITHUB_OUTPUT
+ shell: bash
+
+ - name: Cache Docker Image
+ uses: actions/cache@v4
+ id: cache-toolchain-espressif
+ with:
+ path: ${{ steps.set-docker-image.outputs.DOCKER_IMAGE }}
+ key: ${{ runner.os }}-${{ inputs.toolchain }}-${{ inputs.toolchain_url }}
+
+ - name: Pull and Save Docker Image
+ if: steps.cache-toolchain-espressif.outputs.cache-hit != 'true'
+ run: |
+ docker pull espressif/idf:${{ inputs.toolchain_url }}
+ mkdir -p ~/cache/${{ inputs.toolchain }}
+ docker save -o $DOCKER_IMAGE espressif/idf:${{ inputs.toolchain_url }}
+ du -sh $DOCKER_IMAGE
+ shell: bash
+
+ - name: Load Docker Image
+ if: steps.cache-toolchain-espressif.outputs.cache-hit == 'true'
+ run: |
+ du -sh $DOCKER_IMAGE
+ docker load --input $DOCKER_IMAGE
+ shell: bash