Added auto caching for Github CI.

This commit is contained in:
23rd 2020-02-24 16:51:53 +03:00
parent 2b2ac2e48f
commit 1ca096e7ce
3 changed files with 18 additions and 0 deletions

View File

@ -33,6 +33,7 @@ jobs:
ONLY_CACHE: "false"
MANUAL_CACHING: "6"
DOC_PATH: "docs/building-cmake.md"
AUTO_CACHING: "1"
steps:
- name: Get repository name.
@ -56,6 +57,7 @@ jobs:
p doc
- name: First set up.
shell: bash
run: |
cd ..
mv $REPO_NAME temp
@ -87,6 +89,10 @@ jobs:
gcc --version > CACHE_KEY.txt
echo $MANUAL_CACHING >> CACHE_KEY.txt
if [ "$AUTO_CACHING" == "1" ]; then
thisFile=$REPO_NAME/.github/workflows/linux.yml
echo `md5sum $thisFile | cut -c -32` >> CACHE_KEY.txt
fi
md5cache=$(md5sum CACHE_KEY.txt | cut -c -32)
echo ::set-env name=CACHE_KEY::$md5cache

View File

@ -35,6 +35,8 @@ jobs:
ONLY_CACHE: "false"
MANUAL_CACHING: "2"
DOC_PATH: "docs/building-xcode.md"
AUTO_CACHING: "1"
steps:
- name: Get repository name.
run: echo ::set-env name=REPO_NAME::${GITHUB_REPOSITORY##*/}
@ -61,6 +63,10 @@ jobs:
echo $MIN_MAC >> CACHE_KEY.txt
echo $PREFIX >> CACHE_KEY.txt
echo $MANUAL_CACHING >> CACHE_KEY.txt
if [ "$AUTO_CACHING" == "1" ]; then
thisFile=$REPO_NAME/.github/workflows/mac.yml
echo `md5 -q $thisFile` >> CACHE_KEY.txt
fi
echo ::set-env name=CACHE_KEY::`md5 -q CACHE_KEY.txt`
echo ::add-path::$PWD/Libraries/depot_tools

View File

@ -30,6 +30,8 @@ jobs:
ONLY_CACHE: "false"
MANUAL_CACHING: "2"
DOC_PATH: "docs/building-msvc.md"
AUTO_CACHING: "1"
steps:
- name: Get repository name.
shell: bash
@ -69,6 +71,10 @@ jobs:
- name: Generate cache key.
shell: bash
run: |
if [ "$AUTO_CACHING" == "1" ]; then
thisFile=$REPO_NAME/.github/workflows/win.yml
echo `md5sum $thisFile | awk '{ print $1 }'` >> CACHE_KEY.txt
fi
echo ::set-env name=CACHE_KEY::`md5sum CACHE_KEY.txt | awk '{ print $1 }'`
- name: Choco installs.