diff --git a/.github/workflows/rnmobile-ios-runner.yml b/.github/workflows/rnmobile-ios-runner.yml index 37868c32560aba..60b119ff1ee0c2 100644 --- a/.github/workflows/rnmobile-ios-runner.yml +++ b/.github/workflows/rnmobile-ios-runner.yml @@ -14,6 +14,7 @@ jobs: runs-on: macos-latest strategy: matrix: + xcode: [12.2] native-test-name: [ gutenberg-editor-gallery ] @@ -38,7 +39,7 @@ jobs: uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4 with: path: packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app - key: ${{ runner.os }}-ios-build-${{ hashFiles('ios-checksums.txt') }} + key: ${{ runner.os }}-ios-build-${{ matrix.xcode }}-${{ hashFiles('ios-checksums.txt') }} - name: Restore pods cache uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4 @@ -58,11 +59,11 @@ jobs: - name: Bundle iOS run: npm run native test:e2e:bundle:ios - - name: Switch Xcode Version - run: sudo xcode-select --switch /Applications/Xcode_12.app + - name: Switch Xcode version to ${{ matrix.xcode }} + run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app - name: Build (if needed) - run: test -e packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/gutenberg || npm run native test:e2e:build-app:ios + run: test -e packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/GutenbergDemo || npm run native test:e2e:build-app:ios - name: Run iOS Device Tests run: TEST_RN_PLATFORM=ios npm run native device-tests:local ${{ matrix.native-test-name }} diff --git a/packages/react-native-editor/jest_ui_test_environment.js b/packages/react-native-editor/jest_ui_test_environment.js index 052aa95da0781f..e5e6374936c6f0 100644 --- a/packages/react-native-editor/jest_ui_test_environment.js +++ b/packages/react-native-editor/jest_ui_test_environment.js @@ -13,8 +13,13 @@ const JSDOMEnvironment = require( 'jest-environment-jsdom' ); class CustomEnvironment extends JSDOMEnvironment { async setup() { - await super.setup(); - this.global.editorPage = await initializeEditorPage(); + try { + await super.setup(); + this.global.editorPage = await initializeEditorPage(); + } catch ( error ) { + // eslint-disable-next-line no-console + console.error( 'E2E setup exception:', error ); + } } async teardown() {