Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
zetavg committed Jan 13, 2025
1 parent a23db28 commit 0842d04
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/build-ios-test-container-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ jobs:
BUILD_HASH_FROM_CACHE=$(curl "$KV_STORE_REDIS_REST_URL/get/${{ env.app_id }}-build-hash-from-pre-build-hash-${{ steps.calculate-pre-build-hash.outputs.pre_build_hash }}" -H "Authorization: Bearer $KV_STORE_REDIS_REST_TOKEN" | jq -r '.result')
if [ "$BUILD_HASH_FROM_CACHE" != "null" ]; then
curl -X POST "$KV_STORE_REDIS_REST_URL/EXPIRE/${{ env.app_id }}-build-hash-from-pre-build-hash-${{ steps.calculate-pre-build-hash.outputs.pre_build_hash }}/2592000" -H "Authorization: Bearer $KV_STORE_REDIS_REST_TOKEN" # Reset TTL to 30 days
echo "Build hash from cache: $BUILD_HASH_FROM_CACHE"
echo "build_hash=$BUILD_HASH_FROM_CACHE" >> $GITHUB_OUTPUT
curl -X POST "$KV_STORE_REDIS_REST_URL/EXPIRE/${{ env.app_id }}-build-hash-from-pre-build-hash-${{ steps.calculate-pre-build-hash.outputs.pre_build_hash }}/2592000" -H "Authorization: Bearer $KV_STORE_REDIS_REST_TOKEN" # Reset TTL to 30 days
else
echo 'No cached build hash found.'
echo "build_hash=null" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -168,10 +168,12 @@ jobs:
env:
cache-name: ${{ env.app_id }}-build
with:
key: ${{ runner.os }}-${{ env.cache-name }}-${{ inputs.configuration }}-${{ steps.calculate-build-hash.outputs.build_hash }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-${{ inputs.configuration }}-
${{ runner.os }}-${{ env.cache-name }}-
# This cache can be huge, so we share it among all configurations instead of creating a cache for each one.
# key: ${{ runner.os }}-${{ env.cache-name }}-${{ inputs.configuration }}-${{ steps.calculate-build-hash.outputs.build_hash }}
# restore-keys: |
# ${{ runner.os }}-${{ env.cache-name }}-${{ inputs.configuration }}-
# ${{ runner.os }}-${{ env.cache-name }}-
key: ${{ runner.os }}-${{ env.cache-name }}
path: |
${{ env.test_container_app_path }}/build
Expand Down Expand Up @@ -201,6 +203,14 @@ jobs:
path: |
${{ env.test_container_app_path }}/xcodebuild.log
- name: Save Build Cache
uses: actions/cache/save@v4
if: ${{ always() && !steps.pre-check-has-build.outputs.cache-hit && !steps.check-has-build.outputs.cache-hit }}
with:
key: ${{ steps.restore-build-cache.outputs.cache-primary-key }}
path: |
${{ env.test_container_app_path }}/build
# Not useful since it's hard to find which run that actually built the app. Instead, we re-upload the app to artifacts in subsequent workflows if tests failed.
# - name: Upload Built App to Artifacts
# if: ${{ !steps.pre-check-has-build.outputs.cache-hit && !steps.check-has-build.outputs.cache-hit }}
Expand Down

0 comments on commit 0842d04

Please sign in to comment.