GitHub Actions: Cache dependencies

This commit is contained in:
past-due 2020-12-08 13:21:57 -05:00
parent aa46313ae6
commit 3443a94407

View File

@ -41,11 +41,33 @@ jobs:
# See: https://github.com/actions/virtual-environments/tree/main/images/macos
run: sudo xcode-select -switch /Applications/Xcode_12.2.app/Contents/Developer
- name: Create Build Logs Dir
- name: Prep
id: prep
run: |
echo "Create Build Logs Dir"
mkdir -p "${HOME}/build_logs"
echo "Get Xcode version info"
XCODE_VERSION="$(xcodebuild -version)"
echo "${XCODE_VERSION}"
XCODE_VERSION="$(echo "${XCODE_VERSION}" | tr '\t\r\n ' '_')"
echo "${XCODE_VERSION}"
echo "::set-output name=XCODE_VERSION::${XCODE_VERSION}"
- name: Cache Dependencies
id: cache-dependencies
if: success() && !(github.event_name == 'push' && contains(github.ref, 'refs/tags/')) # never cache dependencies for pushed tags
uses: actions/cache@v2
with:
path: External/build/
key: ${{ runner.os }}-${{ steps.prep.outputs.XCODE_VERSION }}-${{ matrix.platform }}-${{ hashFiles('fetchDependencies','ExternalRevisions/**','ExternalDependencies.xcodeproj/**','Scripts/**') }}
- name: Fetch Dependencies (Use Built Cache)
if: steps.cache-dependencies.outputs.cache-hit == 'true'
run: |
./fetchDependencies -v --no-parallel-build --none
- name: Fetch Dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
./fetchDependencies -v --no-parallel-build --${{ matrix.platform }}