-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OSS ONLY] Cherrypicking caching to 4X (#3432)
his commit implements a more efficient method of caching compilations. Cache now restored will now be guaranteed to compatible with the version and build configuration of compilations. We will now save 5-8 mins in version upgrade and dump restore tests. Key changes: Implemented new format for cache keys which includes github hashcode of corresponding engine branch and build mode to better identify the cache stored in a key. New format "ccache-engineHashcode-buildMode-extensionHashcode". Cache restoration handled by build-modified-postgres.yml and saving by save-ccache.yml composite actions. Removed timeStamp based caching. Task: BABEL-5564 Signed-off-by: SiddharthBITS <[email protected]>
- Loading branch information
1 parent
11c3287
commit 31c5413
Showing
12 changed files
with
131 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: 'Save ccache on push' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- name: Setup new cache key | ||
if: always() | ||
run: | | ||
echo "CCACHE_KEY=${{env.CRESTORE_KEY}}-$(git rev-parse --short HEAD)" >> $GITHUB_ENV | ||
echo "Event : ${{ github.event_name }}" | ||
echo "Save ccache : ${{ env.SAVE_CCACHE }}" | ||
if [[ ${{ github.event_name != 'pull_request' || env.SAVE_CCACHE == 1 }} == true ]]; then | ||
echo "Cache to be Saved" | ||
echo "SAVE_CACHE_HERE=1" >> $GITHUB_ENV | ||
else | ||
echo "Cache shouldn't be Saved" | ||
echo "SAVE_CACHE_HERE=0" >> $GITHUB_ENV | ||
fi | ||
shell: bash | ||
|
||
- name: Save ccache | ||
uses: actions/cache/save@v4 | ||
if: env.SAVE_CACHE_HERE == 1 | ||
with: | ||
path: | ||
~/.ccache | ||
key: | ||
ccache-${{ env.CCACHE_KEY }} | ||
|
||
- name: Clean ccache directory and unset env variables | ||
if: always() | ||
shell: bash | ||
run: | | ||
rm -rf ~/.ccache | ||
echo "CCACHE_KEY=" >> $GITHUB_ENV | ||
echo "SAVE_CCACHE=" >> $GITHUB_ENV | ||
echo "SAVE_CACHE_HERE=" >> $GITHUB_ENV | ||
echo "CRESTORE_KEY=" >> $GITHUB_ENV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters