mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
51 lines
1.6 KiB
YAML
51 lines
1.6 KiB
YAML
name: Restore cache
|
|
description: Find and restores conan and ccache cache
|
|
inputs:
|
|
conan_dir:
|
|
description: Path to .conan directory
|
|
required: true
|
|
ccache_dir:
|
|
description: Path to .ccache directory
|
|
required: true
|
|
outputs:
|
|
conan_hash:
|
|
description: Hash to use as a part of conan cache key
|
|
value: ${{ steps.conan_hash.outputs.hash }}
|
|
conan_cache_hit:
|
|
description: True if conan cache has been downloaded
|
|
value: ${{ steps.conan_cache.outputs.cache-hit }}
|
|
ccache_cache_hit:
|
|
description: True if ccache cache has been downloaded
|
|
value: ${{ steps.ccache_cache.outputs.cache-hit }}
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Find common commit
|
|
id: git_common_ancestor
|
|
uses: ./.github/actions/git_common_ancestor
|
|
|
|
- name: Calculate conan hash
|
|
id: conan_hash
|
|
shell: bash
|
|
run: |
|
|
conan info . -j info.json -o clio:tests=True
|
|
packages_info=$(cat info.json | jq '.[] | "\(.display_name): \(.id)"' | grep -v 'clio')
|
|
echo "$packages_info"
|
|
hash=$(echo "$packages_info" | shasum -a 256 | cut -d ' ' -f 1)
|
|
rm info.json
|
|
echo "hash=$hash" >> $GITHUB_OUTPUT
|
|
|
|
- name: Restore conan cache
|
|
uses: actions/cache/restore@v3
|
|
id: conan_cache
|
|
with:
|
|
path: ${{ inputs.conan_dir }}/data
|
|
key: clio-conan_data-${{ runner.os }}-develop-${{ steps.conan_hash.outputs.hash }}
|
|
|
|
- name: Restore ccache cache
|
|
uses: actions/cache/restore@v3
|
|
id: ccache_cache
|
|
with:
|
|
path: ${{ inputs.ccache_dir }}
|
|
key: clio-ccache-${{ runner.os }}-develop-${{ steps.git_common_ancestor.outputs.commit }}
|