From 2f54b100c826b7c5f97d444be73935fcb76042ba Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 20 Sep 2024 13:19:19 -0700 Subject: [PATCH 1/8] Revert "Workaround GHA download overload crashes (#11)" This reverts commit 2a794978a34609bea58f89f80c584f266a367d06. --- .github/workflows/spm.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml index 5fee3c3..977ef88 100644 --- a/.github/workflows/spm.yml +++ b/.github/workflows/spm.yml @@ -30,26 +30,19 @@ jobs: strategy: matrix: os: [macos-14] - # Target and Xcode matrix commented to workaround GHA download overload crashes - # target: [iOS, tvOS, macOS, catalyst, visionOS] - # xcode: [Xcode_15.2, Xcode_16_Release_Candidate] + target: [iOS, tvOS, macOS, catalyst, visionOS] + xcode: [Xcode_15.2, Xcode_15.4, Xcode_16_Release_Candidate] runs-on: ${{ matrix.os }} env: FIREBASE_MAIN: 1 DISABLE_INTEGRATION_TESTS: 1 steps: - uses: actions/checkout@v4 + - name: Xcode + run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Setup Scripts Directory run: ./setup-scripts.sh - - name: Xcode 15 - run: sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer - name: Initialize xcodebuild run: xcodebuild -list - name: iOS Unit Tests - run: scripts/third_party/travis/retry.sh scripts/build.sh FirebaseDataConnect iOS spm - - name: tvOS Unit Tests - run: scripts/third_party/travis/retry.sh scripts/build.sh FirebaseDataConnect tvOS spm - - name: macOS Unit Tests - run: scripts/third_party/travis/retry.sh scripts/build.sh FirebaseDataConnect macOS spm - - name: visionOS Unit Tests - run: scripts/third_party/travis/retry.sh scripts/build.sh FirebaseDataConnect visionOS spm + run: scripts/third_party/travis/retry.sh scripts/build.sh FirebaseDataConnect ${{ matrix.target }} spm From 71fa2e205cd02237aae21a13c41f7fb71ce7624b Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 20 Sep 2024 14:39:18 -0700 Subject: [PATCH 2/8] Restore GHA matrix with SPM cache --- .github/workflows/spm.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml index 977ef88..2f59d5e 100644 --- a/.github/workflows/spm.yml +++ b/.github/workflows/spm.yml @@ -23,6 +23,25 @@ jobs: if: ${{ github.event_name == 'schedule' }} run: echo '::set-output name=WAS_CHANGED::'$(test -n "$(git log --format=%H --since='24 hours ago')" && echo 'true' || echo 'false') + + spm-package-resolved: + runs-on: macos-14 + outputs: + package_resolved_hash: ${{ steps.cache.outputs.cache-primary-key }} + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} + spm: needs: changed_today if: ${{ github.event_name == 'pull_request' || needs.changed_today.outputs.WAS_CHANGED == 'true' }} @@ -31,13 +50,18 @@ jobs: matrix: os: [macos-14] target: [iOS, tvOS, macOS, catalyst, visionOS] - xcode: [Xcode_15.2, Xcode_15.4, Xcode_16_Release_Candidate] + xcode: [Xcode_15.2, Xcode_15.4, Xcode_16] runs-on: ${{ matrix.os }} + needs: spm-package-resolved env: FIREBASE_MAIN: 1 DISABLE_INTEGRATION_TESTS: 1 steps: - uses: actions/checkout@v4 + - uses: actions/cache/restore@v4 + with: + path: .build + key: ${{ runner.os }}-spm-${{needs.spm-package-resolved.outputs.package_resolved_hash}} - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Setup Scripts Directory From c45e3d497ef42da67e6092a230aedce2e6a1979d Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 20 Sep 2024 14:41:46 -0700 Subject: [PATCH 3/8] fixes --- .github/workflows/spm.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml index 2f59d5e..1fac6a0 100644 --- a/.github/workflows/spm.yml +++ b/.github/workflows/spm.yml @@ -23,13 +23,13 @@ jobs: if: ${{ github.event_name == 'schedule' }} run: echo '::set-output name=WAS_CHANGED::'$(test -n "$(git log --format=%H --since='24 hours ago')" && echo 'true' || echo 'false') - spm-package-resolved: runs-on: macos-14 outputs: package_resolved_hash: ${{ steps.cache.outputs.cache-primary-key }} env: - FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + FIREBASE_MAIN: 1 + DISABLE_INTEGRATION_TESTS: 1 steps: - uses: actions/checkout@v4 - name: Generate Swift Package.resolved From 9738589bbc5ac36091a5a2eda4e4d57dbbc02c06 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 20 Sep 2024 14:44:45 -0700 Subject: [PATCH 4/8] fix yaml --- .github/workflows/spm.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml index 1fac6a0..e12ac2c 100644 --- a/.github/workflows/spm.yml +++ b/.github/workflows/spm.yml @@ -43,7 +43,7 @@ jobs: key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} spm: - needs: changed_today + needs: changed_today, spm-package-resolved if: ${{ github.event_name == 'pull_request' || needs.changed_today.outputs.WAS_CHANGED == 'true' }} strategy: @@ -52,7 +52,6 @@ jobs: target: [iOS, tvOS, macOS, catalyst, visionOS] xcode: [Xcode_15.2, Xcode_15.4, Xcode_16] runs-on: ${{ matrix.os }} - needs: spm-package-resolved env: FIREBASE_MAIN: 1 DISABLE_INTEGRATION_TESTS: 1 From bb90f12dd51d142c429fb889ccdcd9c7acde374e Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 20 Sep 2024 14:49:04 -0700 Subject: [PATCH 5/8] needs fix --- .github/workflows/spm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml index e12ac2c..250421c 100644 --- a/.github/workflows/spm.yml +++ b/.github/workflows/spm.yml @@ -43,7 +43,7 @@ jobs: key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} spm: - needs: changed_today, spm-package-resolved + needs: [changed_today, spm-package-resolved] if: ${{ github.event_name == 'pull_request' || needs.changed_today.outputs.WAS_CHANGED == 'true' }} strategy: From 48ba0f209c27f34594b72e52cc7c975d9c46de70 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 20 Sep 2024 15:00:20 -0700 Subject: [PATCH 6/8] remove xcodebuild -list --- .github/workflows/spm.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml index 250421c..517df7c 100644 --- a/.github/workflows/spm.yml +++ b/.github/workflows/spm.yml @@ -65,7 +65,5 @@ jobs: run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Setup Scripts Directory run: ./setup-scripts.sh - - name: Initialize xcodebuild - run: xcodebuild -list - - name: iOS Unit Tests + - name: Unit Tests run: scripts/third_party/travis/retry.sh scripts/build.sh FirebaseDataConnect ${{ matrix.target }} spm From 9b4e74190eeee869813d9d5dae7de43dfe03cff2 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 20 Sep 2024 16:07:29 -0700 Subject: [PATCH 7/8] single name for key --- .github/workflows/spm.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml index 517df7c..9b47998 100644 --- a/.github/workflows/spm.yml +++ b/.github/workflows/spm.yml @@ -26,7 +26,7 @@ jobs: spm-package-resolved: runs-on: macos-14 outputs: - package_resolved_hash: ${{ steps.cache.outputs.cache-primary-key }} + cache-primary-key: ${{ steps.cache.outputs.cache-primary-key }} env: FIREBASE_MAIN: 1 DISABLE_INTEGRATION_TESTS: 1 @@ -60,7 +60,7 @@ jobs: - uses: actions/cache/restore@v4 with: path: .build - key: ${{ runner.os }}-spm-${{needs.spm-package-resolved.outputs.package_resolved_hash}} + key: ${{ runner.os }}-spm-${{needs.spm-package-resolved.outputs.cache-primary-key}} - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Setup Scripts Directory From 69ed48ebb7812848abce1043110a6e3a1e96fb2a Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 20 Sep 2024 16:13:09 -0700 Subject: [PATCH 8/8] fix cache key based on https://github.com/firebase/firebase-ios-sdk/pull/13687 --- .github/workflows/spm.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml index 9b47998..cc9b9d8 100644 --- a/.github/workflows/spm.yml +++ b/.github/workflows/spm.yml @@ -26,7 +26,7 @@ jobs: spm-package-resolved: runs-on: macos-14 outputs: - cache-primary-key: ${{ steps.cache.outputs.cache-primary-key }} + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} env: FIREBASE_MAIN: 1 DISABLE_INTEGRATION_TESTS: 1 @@ -36,6 +36,11 @@ jobs: id: swift_package_resolve run: | swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" - uses: actions/cache/save@v4 id: cache with: @@ -60,7 +65,7 @@ jobs: - uses: actions/cache/restore@v4 with: path: .build - key: ${{ runner.os }}-spm-${{needs.spm-package-resolved.outputs.cache-primary-key}} + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Setup Scripts Directory