fix: normalize rust cache keys
This commit is contained in:
@@ -24,6 +24,8 @@ runs:
|
|||||||
id: cache-key
|
id: cache-key
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
OS=$(printf '%s' '${{ runner.os }}' | tr '[:upper:]' '[:lower:]')
|
||||||
|
ARCH=$(printf '%s' '${{ runner.arch }}' | tr '[:upper:]' '[:lower:]')
|
||||||
{
|
{
|
||||||
printf 'toolchain=%s\n' '${{ inputs.toolchain }}'
|
printf 'toolchain=%s\n' '${{ inputs.toolchain }}'
|
||||||
find . \
|
find . \
|
||||||
@@ -35,8 +37,8 @@ runs:
|
|||||||
} > /tmp/rust-cache-fingerprint
|
} > /tmp/rust-cache-fingerprint
|
||||||
HASH=$(sha256sum /tmp/rust-cache-fingerprint | cut -d' ' -f1)
|
HASH=$(sha256sum /tmp/rust-cache-fingerprint | cut -d' ' -f1)
|
||||||
echo "hash=$HASH" >> $GITHUB_OUTPUT
|
echo "hash=$HASH" >> $GITHUB_OUTPUT
|
||||||
echo "key=${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-${{ inputs.toolchain }}-$HASH" >> $GITHUB_OUTPUT
|
echo "key=${{ inputs.cache-prefix }}-$OS-$ARCH-${{ inputs.toolchain }}-$HASH" >> $GITHUB_OUTPUT
|
||||||
echo "restore-prefix=${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-${{ inputs.toolchain }}-" >> $GITHUB_OUTPUT
|
echo "restore-prefix=${{ inputs.cache-prefix }}-$OS-$ARCH-${{ inputs.toolchain }}-" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Restore Rust cache
|
- name: Restore Rust cache
|
||||||
id: cache-restore
|
id: cache-restore
|
||||||
@@ -54,6 +56,12 @@ runs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ steps.cache-key.outputs.restore-prefix }}
|
${{ steps.cache-key.outputs.restore-prefix }}
|
||||||
|
|
||||||
|
- name: Show Rust cache status
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "Rust cache key: ${{ steps.cache-key.outputs.key }}"
|
||||||
|
echo "Rust cache hit: ${{ steps.cache-restore.outputs.cache-hit }}"
|
||||||
|
|
||||||
- name: Setup Rust
|
- name: Setup Rust
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user