mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
CI improvements (#867)
* Generate conan profile in CI * Move linux build into main workflow * Add saving/restoring conan data * Move cache to Linux * Fix error * Change key to hash from conanfile * Fix path error * Populate cache only in develop branch * Big refactor - Move duplicated code to actions - Isolate mac build from home directory - Separate ccache and conan caches * Fix errors * Change ccache cache name and fix errors * Always populate cache * Use newer ccache on Linux * Strip tests * Better conan hash
This commit is contained in:
41
.github/actions/restore_cache/action.yml
vendored
Normal file
41
.github/actions/restore_cache/action.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
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 }}
|
||||
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
|
||||
hash=$(cat info.json | jq '.[] | "\(.id), \(.package_revision)"' | 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
|
||||
with:
|
||||
path: ${{ inputs.ccache_dir }}
|
||||
key: clio-ccache-${{ runner.os }}-develop-${{ steps.git_common_ancestor.outputs.commit }}
|
||||
Reference in New Issue
Block a user