Skip to content

Commit

Permalink
correct cache toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed May 13, 2024
1 parent a65300f commit f8edfd6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/actions/setup_toolchain/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Setup Toolchain

inputs:
toolchain:
description: 'Toolchain name'
required: true
type: string
toolchain_url:
description: 'Toolchain URL or version'
required: false
type: string

outputs:
build_option:
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/setup_toolchain/download/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ runs:
steps:
- name: Cache Toolchain
uses: actions/cache@v4
id: cache-toolchain-${{ inputs.toolchain }}
id: cache-toolchain-download
with:
path: ~/cache/${{ inputs.toolchain }}
key: ${{ runner.os }}-${{ inputs.toolchain }}-${{ inputs.toolchain_url }}

- name: Install Toolchain
if: steps.cache-toolchain-${{ inputs.toolchain }}.outputs.cache-hit != 'true'
if: steps.cache-toolchain-download.outputs.cache-hit != 'true'
run: |
mkdir -p ~/cache/${{ inputs.toolchain }}
wget --progress=dot:mega ${{ inputs.toolchain_url }} -O toolchain.tar.gz
Expand Down
8 changes: 4 additions & 4 deletions .github/actions/setup_toolchain/espressif/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
description: 'Toolchain name'
required: true
toolchain_url:
description: 'Toolchain URL'
description: 'Toolchain URL or version'
required: true

runs:
Expand All @@ -16,20 +16,20 @@ runs:

- name: Cache Docker Image
uses: actions/cache@v4
id: cache-toolchain-${{ inputs.toolchain }}
id: cache-toolchain-espressif
with:
path: $DOCKER_IMAGE
key: ${{ runner.os }}-${{ inputs.toolchain }}-${{ inputs.toolchain_url }}

- name: Pull and Save Docker Image
if: steps.cache-toolchain-${{ inputs.toolchain }}.outputs.cache-hit != 'true'
if: steps.cache-toolchain-espressif.outputs.cache-hit != 'true'
run: |
docker pull espressif/idf:${{ inputs.toolchain_url }}
docker save espressif/idf:${{ inputs.toolchain_url }} > $DOCKER_IMAGE
shell: bash

- name: Load Docker Image
if: steps.cache-toolchain.outputs.cache-hit == 'true'
if: steps.cache-toolchain-espressif.outputs.cache-hit == 'true'
run: |
docker load < $DOCKER_IMAGE
shell: bash

0 comments on commit f8edfd6

Please sign in to comment.