Skip to content

Commit 71fa2e2

Browse files
committed
Restore GHA matrix with SPM cache
1 parent 2f54b10 commit 71fa2e2

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.github/workflows/spm.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,25 @@ jobs:
2323
if: ${{ github.event_name == 'schedule' }}
2424
run: echo '::set-output name=WAS_CHANGED::'$(test -n "$(git log --format=%H --since='24 hours ago')" && echo 'true' || echo 'false')
2525

26+
27+
spm-package-resolved:
28+
runs-on: macos-14
29+
outputs:
30+
package_resolved_hash: ${{ steps.cache.outputs.cache-primary-key }}
31+
env:
32+
FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Generate Swift Package.resolved
36+
id: swift_package_resolve
37+
run: |
38+
swift package resolve
39+
- uses: actions/cache/save@v4
40+
id: cache
41+
with:
42+
path: .build
43+
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
44+
2645
spm:
2746
needs: changed_today
2847
if: ${{ github.event_name == 'pull_request' || needs.changed_today.outputs.WAS_CHANGED == 'true' }}
@@ -31,13 +50,18 @@ jobs:
3150
matrix:
3251
os: [macos-14]
3352
target: [iOS, tvOS, macOS, catalyst, visionOS]
34-
xcode: [Xcode_15.2, Xcode_15.4, Xcode_16_Release_Candidate]
53+
xcode: [Xcode_15.2, Xcode_15.4, Xcode_16]
3554
runs-on: ${{ matrix.os }}
55+
needs: spm-package-resolved
3656
env:
3757
FIREBASE_MAIN: 1
3858
DISABLE_INTEGRATION_TESTS: 1
3959
steps:
4060
- uses: actions/checkout@v4
61+
- uses: actions/cache/restore@v4
62+
with:
63+
path: .build
64+
key: ${{ runner.os }}-spm-${{needs.spm-package-resolved.outputs.package_resolved_hash}}
4165
- name: Xcode
4266
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
4367
- name: Setup Scripts Directory

0 commit comments

Comments
 (0)