@@ -22,12 +22,30 @@ jobs:
22
22
- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
23
23
with :
24
24
persist-credentials : false
25
+ - name : Attempt to restore dependencies cache
26
+ id : cache-packages
27
+ timeout-minutes : 4
28
+ continue-on-error : true
29
+ uses : actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
30
+ with :
31
+ path : ~/Library/Developer/Xcode/DerivedData/Amplify
32
+ key : amplify-packages-${{ hashFiles('Package.resolved') }}
33
+ restore-keys : |
34
+ amplify-packages-
25
35
- name : Build Amplify Swift for iOS
26
36
uses : ./.github/composite_actions/run_xcodebuild
27
37
with :
28
38
scheme : Amplify-Package
29
39
destination : ' platform=iOS Simulator,name=iPhone 14,OS=16.4'
30
40
xcode_path : ' /Applications/Xcode_14.3.app'
41
+ disable_package_resolution : ${{ steps.cache-packages.outputs.cache-hit }}
42
+ other_flags : ' -derivedDataPath Build -clonedSourcePackagesDirPath ~/Library/Developer/Xcode/DerivedData/Amplify'
43
+ - name : Save the dependencies cache if necessary
44
+ if : steps.cache-packages.outputs.cache-hit != 'true' && github.ref_name == 'main'
45
+ uses : actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
46
+ with :
47
+ path : ~/Library/Developer/Xcode/DerivedData/Amplify
48
+ key : ${{ steps.cache-packages.outputs.cache-primary-key }}
31
49
32
50
build-amplify-swift-macOS :
33
51
runs-on : macos-13
@@ -36,13 +54,24 @@ jobs:
36
54
- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
37
55
with :
38
56
persist-credentials : false
57
+ - name : Cache packages
58
+ id : cache-packages
59
+ timeout-minutes : 4
60
+ uses : actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
61
+ with :
62
+ path : ~/Library/Developer/Xcode/DerivedData/Amplify
63
+ key : amplify-packages-${{ hashFiles('Package.resolved') }}
64
+ restore-keys : |
65
+ amplify-packages-
39
66
- name : Build Amplify Swift for macOS
40
67
uses : ./.github/composite_actions/run_xcodebuild
41
68
with :
42
69
scheme : Amplify-Package
43
70
destination : platform=macOS,arch=x86_64
44
71
sdk : macosx
45
72
xcode_path : ' /Applications/Xcode_14.3.app'
73
+ disable_package_resolution : ${{ steps.cache-packages.outputs.cache-hit }}
74
+ other_flags : ' -derivedDataPath Build -clonedSourcePackagesDirPath ~/Library/Developer/Xcode/DerivedData/Amplify'
46
75
47
76
build-amplify-swift-tvOS :
48
77
runs-on : macos-13
@@ -51,13 +80,24 @@ jobs:
51
80
- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
52
81
with :
53
82
persist-credentials : false
83
+ - name : Cache packages
84
+ timeout-minutes : 4
85
+ id : cache-packages
86
+ uses : actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
87
+ with :
88
+ path : ~/Library/Developer/Xcode/DerivedData/Amplify
89
+ key : amplify-packages-${{ hashFiles('Package.resolved') }}
90
+ restore-keys : |
91
+ amplify-packages-
54
92
- name : Build Amplify Swift for tvOS
55
93
uses : ./.github/composite_actions/run_xcodebuild
56
94
with :
57
95
scheme : Amplify-Package
58
96
destination : platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=16.4
59
97
sdk : appletvsimulator
60
98
xcode_path : ' /Applications/Xcode_14.3.app'
99
+ disable_package_resolution : ${{ steps.cache-packages.outputs.cache-hit }}
100
+ other_flags : ' -derivedDataPath Build -clonedSourcePackagesDirPath ~/Library/Developer/Xcode/DerivedData/Amplify'
61
101
62
102
build-amplify-swift-watchOS :
63
103
runs-on : macos-13
@@ -66,13 +106,24 @@ jobs:
66
106
- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
67
107
with :
68
108
persist-credentials : false
109
+ - name : Cache packages
110
+ id : cache-packages
111
+ timeout-minutes : 4
112
+ uses : actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
113
+ with :
114
+ path : ~/Library/Developer/Xcode/DerivedData/Amplify
115
+ key : amplify-packages-${{ hashFiles('Package.resolved') }}
116
+ restore-keys : |
117
+ amplify-packages-
69
118
- name : Build Amplify Swift for watchOS
70
119
uses : ./.github/composite_actions/run_xcodebuild
71
120
with :
72
121
scheme : Amplify-Package
73
122
destination : platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.4
74
123
sdk : watchsimulator
75
124
xcode_path : ' /Applications/Xcode_14.3.app'
125
+ disable_package_resolution : ${{ steps.cache-packages.outputs.cache-hit }}
126
+ other_flags : ' -derivedDataPath Build -clonedSourcePackagesDirPath ~/Library/Developer/Xcode/DerivedData/Amplify'
76
127
77
128
confirm-pass :
78
129
runs-on : ubuntu-latest
0 commit comments