Skip to content

Commit 52e07ad

Browse files
fix(lynx-ci): cache generated iOS workspace
1 parent 682af30 commit 52e07ad

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

.github/workflows/e2e-lynx.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,12 @@ jobs:
166166
~/.cocoapods/repos/trunk
167167
~/Library/Caches/CocoaPods
168168
apps/lynx-module-federation-demo/ios/Pods
169+
apps/lynx-module-federation-demo/ios/OrbitControl.xcworkspace
169170
apps/lynx-module-federation-demo/ios/vendor/bundle
170171
apps/lynx-module-federation-demo/ios/build/DerivedData/Build
171172
apps/lynx-module-federation-demo/ios/build/DerivedData/ModuleCache.noindex
172173
apps/lynx-module-federation-demo/ios/build/DerivedData/SDKStatCaches.noindex
173-
key: ${{ runner.os }}-${{ runner.arch }}-lynx-ios-build-v2-xcode-16.4-ruby-${{ env.RUBY_VERSION }}-${{ hashFiles('apps/lynx-module-federation-demo/ios/Gemfile', 'apps/lynx-module-federation-demo/ios/Gemfile.lock', 'apps/lynx-module-federation-demo/ios/Podfile', 'apps/lynx-module-federation-demo/ios/Podfile.lock') }}-${{ hashFiles('apps/lynx-module-federation-demo/ios/OrbitControl.xcodeproj/project.pbxproj') }}
174+
key: ${{ runner.os }}-${{ runner.arch }}-lynx-ios-build-v3-xcode-16.4-ruby-${{ env.RUBY_VERSION }}-${{ hashFiles('apps/lynx-module-federation-demo/ios/Gemfile', 'apps/lynx-module-federation-demo/ios/Gemfile.lock', 'apps/lynx-module-federation-demo/ios/Podfile', 'apps/lynx-module-federation-demo/ios/Podfile.lock') }}-${{ hashFiles('apps/lynx-module-federation-demo/ios/OrbitControl.xcodeproj/project.pbxproj') }}
174175

175176
- name: Download native artifacts
176177
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
@@ -196,6 +197,7 @@ jobs:
196197
bundle config set path vendor/bundle
197198
bundle check
198199
cmp Podfile.lock Pods/Manifest.lock
200+
test -f OrbitControl.xcworkspace/contents.xcworkspacedata
199201
200202
- name: Run standalone iOS federation E2E
201203
run: node apps/lynx-module-federation-demo/test/ios/run.mjs
@@ -211,11 +213,12 @@ jobs:
211213
~/.cocoapods/repos/trunk
212214
~/Library/Caches/CocoaPods
213215
apps/lynx-module-federation-demo/ios/Pods
216+
apps/lynx-module-federation-demo/ios/OrbitControl.xcworkspace
214217
apps/lynx-module-federation-demo/ios/vendor/bundle
215218
apps/lynx-module-federation-demo/ios/build/DerivedData/Build
216219
apps/lynx-module-federation-demo/ios/build/DerivedData/ModuleCache.noindex
217220
apps/lynx-module-federation-demo/ios/build/DerivedData/SDKStatCaches.noindex
218-
key: ${{ runner.os }}-${{ runner.arch }}-lynx-ios-build-v2-xcode-16.4-ruby-${{ env.RUBY_VERSION }}-${{ hashFiles('apps/lynx-module-federation-demo/ios/Gemfile', 'apps/lynx-module-federation-demo/ios/Gemfile.lock', 'apps/lynx-module-federation-demo/ios/Podfile', 'apps/lynx-module-federation-demo/ios/Podfile.lock') }}-${{ hashFiles('apps/lynx-module-federation-demo/ios/OrbitControl.xcodeproj/project.pbxproj') }}
221+
key: ${{ runner.os }}-${{ runner.arch }}-lynx-ios-build-v3-xcode-16.4-ruby-${{ env.RUBY_VERSION }}-${{ hashFiles('apps/lynx-module-federation-demo/ios/Gemfile', 'apps/lynx-module-federation-demo/ios/Gemfile.lock', 'apps/lynx-module-federation-demo/ios/Podfile', 'apps/lynx-module-federation-demo/ios/Podfile.lock') }}-${{ hashFiles('apps/lynx-module-federation-demo/ios/OrbitControl.xcodeproj/project.pbxproj') }}
219222

220223
- name: Upload iOS E2E evidence
221224
if: success()

apps/lynx-module-federation-demo/test/ci-policy.mjs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,19 @@ assert.match(
4848
lynxIosJob,
4949
/name: Save iOS build cache[\s\S]*?uses: actions\/cache\/save@/,
5050
);
51-
assert.match(lynxIosJob, /lynx-ios-build-v2-/);
52-
assert.match(lynxIosJob, /ios\/Pods[\s\S]*?ios\/build\/DerivedData\/Build/);
51+
assert.match(lynxIosJob, /lynx-ios-build-v3-/);
52+
for (const action of ['Restore', 'Save']) {
53+
assert.match(
54+
lynxIosJob,
55+
new RegExp(
56+
`name: ${action} iOS build cache[\\s\\S]*?path: \\|[\\s\\S]*?ios/Pods[\\s\\S]*?ios/OrbitControl\\.xcworkspace[\\s\\S]*?ios/build/DerivedData/Build`,
57+
),
58+
);
59+
}
60+
assert.match(
61+
lynxIosJob,
62+
/cmp Podfile\.lock Pods\/Manifest\.lock\s+test -f OrbitControl\.xcworkspace\/contents\.xcworkspacedata/,
63+
);
5364
assert.doesNotMatch(lynxIosJob, /restore-keys:/);
5465
for (const script of ['e2e:native:ci', 'e2e:web:ci']) {
5566
assert.match(lynxWorkflow, new RegExp(`run ${script}`));

0 commit comments

Comments
 (0)