circle ci skip cache for toolchain

action skip cache for toolchain url hosted by github
This commit is contained in:
hathach 2024-05-21 12:49:57 +07:00
parent c2cfb71dce
commit 4e24ec5e5d
No known key found for this signature in database
GPG Key ID: 26FAB84F615C3C52
2 changed files with 15 additions and 14 deletions

View File

@ -8,14 +8,14 @@ commands:
toolchain_url:
type: string
steps:
- run:
name: Make toolchain cache key
command: echo "<< parameters.toolchain >>-<< parameters.toolchain_url>>" > toolchain_key
- restore_cache:
name: Restore Toolchain Cache
key: deps-{{ checksum "toolchain_key" }}
paths:
- ~/cache/<< parameters.toolchain >>
# - run:
# name: Make toolchain cache key
# command: echo "<< parameters.toolchain >>-<< parameters.toolchain_url>>" > toolchain_key
# - restore_cache:
# name: Restore Toolchain Cache
# key: deps-{{ checksum "toolchain_key" }}
# paths:
# - ~/cache/<< parameters.toolchain >>
- run:
name: Install Toolchain
command: |
@ -25,11 +25,11 @@ commands:
wget << parameters.toolchain_url>> -O toolchain.tar.gz
tar -C ~/cache/<< parameters.toolchain >> -xaf toolchain.tar.gz
fi
- save_cache:
name: Save Toolchain Cache
key: deps-{{ checksum "toolchain_key" }}
paths:
- ~/cache/<< parameters.toolchain >>
# - save_cache:
# name: Save Toolchain Cache
# key: deps-{{ checksum "toolchain_key" }}
# paths:
# - ~/cache/<< parameters.toolchain >>
- run:
name: Setup build environment
command: |

View File

@ -12,6 +12,7 @@ runs:
using: "composite"
steps:
- name: Cache Toolchain
if: ${{ !startsWith(inputs.toolchain_url, 'https://github.com') }}
uses: actions/cache@v4
id: cache-toolchain-download
with:
@ -22,7 +23,7 @@ runs:
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
wget --progress=dot:giga ${{ inputs.toolchain_url }} -O toolchain.tar.gz
tar -C ~/cache/${{ inputs.toolchain }} -xaf toolchain.tar.gz
shell: bash