|
| 1 | +name: Demo Expo App |
| 2 | + |
| 3 | +on: [pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + run-visual-regression-ios: |
| 7 | + runs-on: macos-11 |
| 8 | + # Disable the Expo example test for now, as I'm getting a XCode 65 error which I havent been able to resolve yet. |
| 9 | + # The tests do run locally, so I'm not sure what the issue is. |
| 10 | + if: ${{ false }} |
| 11 | + |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v2 |
| 14 | + |
| 15 | + - name: Get Runner Information |
| 16 | + run: /usr/bin/xcodebuild -version |
| 17 | + |
| 18 | + - name: Get yarn cache directory path |
| 19 | + id: yarn-cache-dir-path |
| 20 | + run: echo "::set-output name=dir::$(yarn cache dir)" |
| 21 | + |
| 22 | + - uses: actions/cache@v3 |
| 23 | + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) |
| 24 | + with: |
| 25 | + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} |
| 26 | + key: ${{ runner.os }}-expo-yarn-${{ hashFiles('**/yarn.lock') }} |
| 27 | + restore-keys: | |
| 28 | + ${{ runner.os }}-expo-yarn- |
| 29 | +
|
| 30 | + - name: Install Dependencies (Library) |
| 31 | + run: yarn install --frozen-lockfile |
| 32 | + working-directory: ./ |
| 33 | + |
| 34 | + - name: Compile the library |
| 35 | + run: yarn build |
| 36 | + working-directory: ./ |
| 37 | + |
| 38 | + - name: Install Dependencies (Example Expo App) |
| 39 | + run: yarn install --frozen-lockfile |
| 40 | + working-directory: ./ExpoExample |
| 41 | + |
| 42 | + - name: Install CocoaPods Gem |
| 43 | + run: gem install cocoapods -v 1.11.0 |
| 44 | + |
| 45 | + - uses: actions/cache@v2 |
| 46 | + with: |
| 47 | + path: ./example/ios/Pods |
| 48 | + key: ${{ runner.os }}-expo-pods-${{ hashFiles('**/Podfile.lock') }} |
| 49 | + restore-keys: | |
| 50 | + ${{ runner.os }}-expo-pods- |
| 51 | +
|
| 52 | + - name: Expo prebuild |
| 53 | + run: yarn expo prebuild --platform ios |
| 54 | + working-directory: ./ExpoExample |
| 55 | + |
| 56 | + - uses: futureware-tech/simulator-action@v1 |
| 57 | + with: |
| 58 | + model: 'iPhone 13 Pro' |
| 59 | + os_version: '>=15.0' |
| 60 | + |
| 61 | + - name: Run Owl Build |
| 62 | + run: yarn owl:build:ios |
| 63 | + working-directory: ./ExpoExample |
| 64 | + |
| 65 | + - name: Run Owl Test |
| 66 | + run: yarn owl:test:ios |
| 67 | + working-directory: ./ExpoExample |
| 68 | + |
| 69 | + - name: Store screenshots and report as artifacts |
| 70 | + uses: actions/upload-artifact@v2 |
| 71 | + if: failure() |
| 72 | + with: |
| 73 | + name: owl-results |
| 74 | + path: ExpoExample/.owl |
| 75 | + |
| 76 | + run-visual-regression-android: |
| 77 | + runs-on: macos-11 |
| 78 | + if: ${{ false }} |
| 79 | + |
| 80 | + steps: |
| 81 | + - uses: actions/checkout@v2 |
| 82 | + |
| 83 | + - name: Get yarn cache directory path |
| 84 | + id: yarn-cache-dir-path |
| 85 | + run: echo "::set-output name=dir::$(yarn cache dir)" |
| 86 | + |
| 87 | + - uses: actions/cache@v2 |
| 88 | + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) |
| 89 | + with: |
| 90 | + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} |
| 91 | + key: ${{ runner.os }}-expo-yarn-${{ hashFiles('**/yarn.lock') }} |
| 92 | + restore-keys: | |
| 93 | + ${{ runner.os }}-expo-yarn- |
| 94 | +
|
| 95 | + - name: Install Dependencies (Library) |
| 96 | + run: yarn install --frozen-lockfile |
| 97 | + working-directory: ./ |
| 98 | + |
| 99 | + - name: Compile the library |
| 100 | + run: yarn build |
| 101 | + working-directory: ./ |
| 102 | + |
| 103 | + - name: Install Dependencies (Example Expo App) |
| 104 | + run: yarn install --frozen-lockfile |
| 105 | + working-directory: ./ExpoExample |
| 106 | + |
| 107 | + - name: Expo prebuild |
| 108 | + run: yarn expo prebuild --platform android |
| 109 | + working-directory: ./ExpoExample |
| 110 | + |
| 111 | + - uses: actions/cache@v2 |
| 112 | + with: |
| 113 | + path: | |
| 114 | + ~/.gradle/caches |
| 115 | + ~/.gradle/wrapper |
| 116 | + key: ${{ runner.os }}-expo-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
| 117 | + restore-keys: | |
| 118 | + ${{ runner.os }}-expo-gradle- |
| 119 | +
|
| 120 | + - name: SKDs - download required images |
| 121 | + run: $ANDROID_HOME/tools/bin/sdkmanager "system-images;android-30;default;x86_64" |
| 122 | + |
| 123 | + - name: SDKs - accept licenses |
| 124 | + run: y | $ANDROID_HOME/tools/bin/sdkmanager --licenses |
| 125 | + |
| 126 | + - name: Emulator - Create |
| 127 | + run: $ANDROID_HOME/tools/bin/avdmanager create avd -n Pixel_API_30 --device 'Nexus 5X' --package "system-images;android-30;default;x86_64" --sdcard 512M |
| 128 | + |
| 129 | + - name: Emulator - Boot |
| 130 | + run: $ANDROID_HOME/emulator/emulator -memory 4096 -avd Pixel_API_30 -wipe-data -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim & |
| 131 | + |
| 132 | + - name: ADB Wait For Device |
| 133 | + run: adb wait-for-any-device |
| 134 | + timeout-minutes: 3 |
| 135 | + |
| 136 | + - name: Run Owl Build |
| 137 | + run: yarn owl:build:android |
| 138 | + working-directory: ./ExpoExample |
| 139 | + |
| 140 | + - name: Run Owl Test |
| 141 | + run: yarn owl:test:android |
| 142 | + working-directory: ./ExpoExample |
| 143 | + |
| 144 | + - name: Store screenshots as artifacts |
| 145 | + uses: actions/upload-artifact@v2 |
| 146 | + if: failure() |
| 147 | + with: |
| 148 | + name: owl-screenshots |
| 149 | + path: ExpoExample/.owl |
0 commit comments