From 9cb78b2863204d6640407a353818481f5a788d68 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 23 Jun 2020 12:36:09 +0200 Subject: [PATCH] GitHub CI: cache SDKs [Mac] GitHub or MacStadium (Mac platform provider) may be rate-limiting downloading the SDKs so we'd like to speed it up. --- .github/scripts/macOS/prepare.sh | 22 ++++++++-------------- .github/workflows/ccpp.yml | 11 +++++++++++ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/scripts/macOS/prepare.sh b/.github/scripts/macOS/prepare.sh index 5e4f2cbf6..f8cb87717 100755 --- a/.github/scripts/macOS/prepare.sh +++ b/.github/scripts/macOS/prepare.sh @@ -26,15 +26,13 @@ mkdir $TEMP_INST cd $TEMP_INST # Install XIMEA -if [ -n "$sdk_pass" ]; then - curl -S --netrc-file <(cat <<<"machine frakira.fi.muni.cz login sdk password $sdk_pass") https://frakira.fi.muni.cz/~xpulec/sdks/m3api.tar.xz -O - sudo tar xJf m3api.tar.xz -C $(xcrun --show-sdk-path)/System/Library/Frameworks +if [ -f /var/tmp/sdks/m3api.tar.xz ]; then + sudo tar xJf /var/tmp/sdks/m3api.tar.xz -C $(xcrun --show-sdk-path)/System/Library/Frameworks fi # Install AJA -if [ -n "$sdk_pass" ]; then - curl -S --netrc-file <(cat <<<"machine frakira.fi.muni.cz login sdk password $sdk_pass") https://frakira.fi.muni.cz/~xpulec/sdks/ntv2sdkmac.zip -O - unzip ntv2sdkmac.zip -d /tmp +if [ -f /var/tmp/sdks/ntv2sdkmac.zip ]; then + unzip /var/tmp/sdks/ntv2sdkmac.zip -d /tmp mv /tmp/ntv2sdk* $AJA_INST cd $AJA_INST/ajalibraries/ajantv2/build xcodebuild -project ajantv2.xcodeproj @@ -45,17 +43,13 @@ if [ -n "$sdk_pass" ]; then fi # DELTACAST -if [ -n "$sdk_pass" ]; then - curl -S --user sdk:$sdk_pass https://frakira.fi.muni.cz/~xpulec/sdks/VideoMasterHD_mac.tar.xz -O - sudo tar xJf VideoMasterHD_mac.tar.xz -C $(xcrun --show-sdk-path)/System/Library/Frameworks - rm VideoMasterHD_mac.tar.xz +if [ -f /var/tmp/sdks/VideoMasterHD_mac.tar.xz ]; then + sudo tar xJf /var/tmp/sdks/VideoMasterHD_mac.tar.xz -C $(xcrun --show-sdk-path)/System/Library/Frameworks fi # Install NDI -if [ -n "$sdk_pass" -a "$GITHUB_REF" = refs/heads/ndi-build ]; then - curl -S --netrc-file <(cat <<<"machine frakira.fi.muni.cz login sdk password $sdk_pass") https://frakira.fi.muni.cz/~xpulec/sdks/NDISDK_Apple.pkg -O - sudo installer -pkg NDISDK_Apple.pkg -target / - rm NDISDK_Apple.pkg +if [ -f /var/tmp/sdks/NDISDK_Apple.pkg ]; then + sudo installer -pkg /var/tmp/sdks/NDISDK_Apple.pkg -target / sudo mv "/Library/NDI SDK for Apple/" /Library/NDI cd /Library/NDI/lib/x64 sudo ln -s libndi.?.dylib libndi.dylib diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 63aadd14f..1111f0f89 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -122,6 +122,17 @@ jobs: - uses: actions/checkout@v1 with: submodules: true + - name: Cache SDKs + id: cache-macos-sdks + uses: actions/cache@v1 + with: + path: '/var/tmp/sdks' + key: cache-macos-sdks + - name: Download SDKs + if: steps.cache-macos-sdk.outputs.cache-hit != 'true' && env.sdk_pass != null + run: | + mkdir /var/tmp/sdks && cd /var/tmp/sdks + curl -S --user sdk:$sdk_pass -O https://frakira.fi.muni.cz/~xpulec/sdks/m3api.tar.xz -O https://frakira.fi.muni.cz/~xpulec/sdks/ntv2sdkmac.zip -O https://frakira.fi.muni.cz/~xpulec/sdks/VideoMasterHD_mac.tar.xz -O https://frakira.fi.muni.cz/~xpulec/sdks/NDISDK_Apple.pkg - name: bootstrap run: | . .github/scripts/environment.sh