|
17 | 17 | jobs: |
18 | 18 | e2e-test: |
19 | 19 | name: E2E-Detox ${{ inputs.test_name }} |
20 | | - runs-on: macos-latest |
| 20 | + runs-on: macos-latest-large |
21 | 21 | timeout-minutes: ${{ inputs.timeout_minutes }} |
22 | 22 |
|
23 | 23 | steps: |
24 | 24 | - name: Checkout repository |
25 | | - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 https://github.com/actions/checkout/commit/24cb9080177205b6e8c946b17badbe402adc938f |
| 25 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
26 | 26 | with: |
27 | 27 | path: amplify-js |
28 | 28 | - name: Setup node and build the repository |
29 | 29 | uses: ./amplify-js/.github/actions/node-and-build |
| 30 | + - name: Set Xcode version |
| 31 | + run: | |
| 32 | + sudo xcode-select -s /Applications/Xcode_16.4.app |
30 | 33 | - name: Setup samples staging repository |
31 | 34 | uses: ./amplify-js/.github/actions/setup-samples-staging |
32 | 35 | with: |
|
44 | 47 | cd ios && pod install |
45 | 48 | working-directory: ${{ inputs.working_directory }} |
46 | 49 | shell: bash |
47 | | - - name: Setup iOS Simulator |
| 50 | + - name: Start iOS simulator (background) |
48 | 51 | run: | |
49 | | - # Check if iPhone 15 device exists |
50 | | - if ! xcrun simctl list devices | grep -q "iPhone 15"; then |
51 | | - echo "iPhone 15 device not found, creating one..." |
52 | | - |
53 | | - # Get the latest available iOS runtime |
54 | | - RUNTIME=$(xcrun simctl list runtimes | grep iOS | tail -1 | awk '{print $NF}') |
55 | | - echo "Using runtime: $RUNTIME" |
56 | | - |
57 | | - # Create iPhone 15 device with available runtime |
58 | | - xcrun simctl create "iPhone 15" "com.apple.CoreSimulator.SimDeviceType.iPhone-15" "$RUNTIME" || \ |
59 | | - xcrun simctl create "iPhone 15" "iPhone 15" "$RUNTIME" || \ |
60 | | - echo "Could not create iPhone 15, will use available device" |
61 | | - fi |
62 | | - |
63 | | - # Boot iPhone 15 if it exists, otherwise use first available iPhone |
64 | | - if xcrun simctl list devices | grep -q "iPhone 15"; then |
65 | | - xcrun simctl boot "iPhone 15" & |
66 | | - else |
67 | | - DEVICE=$(xcrun simctl list devices available | grep "iPhone" | head -1 | sed 's/.*\(iPhone[^(]*\).*/\1/' | xargs) |
68 | | - echo "Using fallback device: $DEVICE" |
69 | | - xcrun simctl boot "$DEVICE" & |
70 | | - fi |
| 52 | + xcrun simctl boot "iPhone 16" & |
71 | 53 | shell: bash |
72 | 54 | - name: Start Metro Packager (background) |
73 | 55 | run: | |
|
96 | 78 | $GITHUB_WORKSPACE/amplify-js/scripts/retry-yarn-script.sh -s 'detox test -c ios.sim.debug -u' -n 3 |
97 | 79 | working-directory: ${{ inputs.working_directory }} |
98 | 80 | shell: bash |
| 81 | + - name: Upload screenshots on failure |
| 82 | + if: failure() |
| 83 | + uses: actions/upload-artifact@v4 |
| 84 | + with: |
| 85 | + name: detox-screenshots-${{ inputs.test_name }} |
| 86 | + path: ${{ inputs.working_directory }}/screenshots/ |
| 87 | + retention-days: 7 |
| 88 | + if-no-files-found: ignore |
0 commit comments