From 494916ec9c275708c59a79c95d91ac349f875deb Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Wed, 9 Aug 2023 04:57:04 -0700 Subject: [PATCH] Add Caching to e2e tests to save time (#38842) Summary: The iOS e2e testing is not caching the cocoapods properly. With this change, we are adding the cache to save some time. ## Changelog: [Internal] - Add caching to iOS e2e jobs Pull Request resolved: https://github.com/facebook/react-native/pull/38842 Test Plan: CircleCI stays green; the job that is using the cache runs faster. | BEFORE | AFTER | | --- | --- | | Screenshot 2023-08-09 at 09 38 48 | Screenshot 2023-08-09 at 09 39 03 | Reviewed By: rshest Differential Revision: D48183742 Pulled By: cipolleschi fbshipit-source-id: d55f492751535e4c84b09bb57173ebc2319e02b4 --- .circleci/config.yml | 56 +++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 40877e9b12c..69e1378e17f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -890,36 +890,38 @@ jobs: package: cmake - setup_ruby: ruby_version: << parameters.ruby_version >> - - run: - name: Install Bundler - command: | - cd packages/rn-tester - bundle check || bundle install - bundle exec pod setup - RCT_NEW_ARCH_ENABLED=1 bundle exec pod install --verbose - run: name: Boot iOS Simulator command: source scripts/.tests.env && xcrun simctl boot "$IOS_DEVICE" || true - - run: - name: Build app - command: | - xcodebuild build \ - -workspace packages/rn-tester/RNTesterPods.xcworkspace \ - -configuration Debug \ - -scheme RNTester \ - -sdk iphonesimulator \ - -derivedDataPath /tmp/e2e/ - - run: - name: Move app to correct directory - command: mv /tmp/e2e/Build/Products/Debug-iphonesimulator/RNTester.app packages/rn-tester-e2e/apps/rn-tester.app - - run: - name: Check Appium server status - command: scripts/circleci/check_appium_server_status.sh - - run: - name: Run E2E tests - command: | - cd packages/rn-tester-e2e - yarn test-e2e ios + - with_xcodebuild_cache: + steps: + - run: + name: Install Bundler + command: | + cd packages/rn-tester + bundle check || bundle install + bundle exec pod setup + RCT_NEW_ARCH_ENABLED=1 bundle exec pod install --verbose + - run: + name: Build app + command: | + xcodebuild build \ + -workspace packages/rn-tester/RNTesterPods.xcworkspace \ + -configuration Debug \ + -scheme RNTester \ + -sdk iphonesimulator \ + -derivedDataPath /tmp/e2e/ + - run: + name: Move app to correct directory + command: mv /tmp/e2e/Build/Products/Debug-iphonesimulator/RNTester.app packages/rn-tester-e2e/apps/rn-tester.app + - run: + name: Check Appium server status + command: scripts/circleci/check_appium_server_status.sh + - run: + name: Run E2E tests + command: | + cd packages/rn-tester-e2e + yarn test-e2e ios # ------------------------- # JOBS: Android E2E Tests