|
| 1 | +name: Test RN/BRN Version |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + inputs: |
| 5 | + RN_Version: |
| 6 | + description: 'ReactNative Version' |
| 7 | + required: true |
| 8 | + type: string |
| 9 | + default: '0.71.0' |
| 10 | + BRN_Version: |
| 11 | + description: 'BRN package version' |
| 12 | + required: true |
| 13 | + type: string |
| 14 | + default: '1.5.3-preview' |
| 15 | + BRN_Postfix: |
| 16 | + description: 'BRN package postfix' |
| 17 | + required: true |
| 18 | + type: string |
| 19 | + default: '0-71' |
| 20 | + |
| 21 | +jobs: |
| 22 | + build-windows: |
| 23 | + runs-on: windows-2019 |
| 24 | + steps: |
| 25 | + - name: Checkout Repo |
| 26 | + uses: actions/checkout@v2.3.3 |
| 27 | + - name: Add msbuild to PATH |
| 28 | + uses: microsoft/setup-msbuild@v1.1 |
| 29 | + - name: Build Playground Windows x64 |
| 30 | + run: | |
| 31 | + npx react-native init Playground --version ${{ github.event.inputs.RN_Version }} |
| 32 | + cp Apps/Playground/playground-shared/App.tsx ./Playground/App.tsx |
| 33 | + cd Playground |
| 34 | + npx react-native-windows-init --overwrite |
| 35 | + npm install @babylonjs/core |
| 36 | + npm install @babylonjs/loaders |
| 37 | + npm install @babylonjs/react-native@${{ github.event.inputs.BRN_Version }} |
| 38 | + npm install @babylonjs/react-native-iosandroid-${{ github.event.inputs.BRN_Postfix }}@${{ github.event.inputs.BRN_Version }} |
| 39 | + npm install @react-native-community/slider |
| 40 | + #npm install react-native-permissions@3.0.0 |
| 41 | + npx react-native autolink-windows |
| 42 | + msbuild.exe /r "./windows/Playground.sln" |
| 43 | + msbuild.exe /p:Configuration="Release" /p:Platform="x64" /m "./windows/Playground.sln" |
| 44 | +
|
| 45 | + - name: Upload UWP x64 |
| 46 | + uses: actions/upload-artifact@v2 |
| 47 | + with: |
| 48 | + name: 'WindowsAppx' |
| 49 | + path: Playground/windows/AppPackages/Playground/Playground_1.0.0.0_x64_Test/Playground_1.0.0.0_x64.appx |
| 50 | + |
| 51 | + build-android: |
| 52 | + runs-on: ubuntu-latest |
| 53 | + steps: |
| 54 | + - name: Checkout Repo |
| 55 | + uses: actions/checkout@v2.3.3 |
| 56 | + - name: Build Playground Android |
| 57 | + run: | |
| 58 | + npm uninstall -g react-native-cli @react-native-community/cli |
| 59 | + npx react-native init Playground --version "${{ github.event.inputs.RN_Version }}" --verbose |
| 60 | + cp Apps/Playground/playground-shared/App.tsx ./Playground/App.tsx |
| 61 | + cd Playground |
| 62 | + npm install @babylonjs/core |
| 63 | + npm install @babylonjs/loaders |
| 64 | + npm install @babylonjs/react-native@${{ github.event.inputs.BRN_Version }} |
| 65 | + npm install @babylonjs/react-native-iosandroid-${{ github.event.inputs.BRN_Postfix }}@${{ github.event.inputs.BRN_Version }} |
| 66 | + npm install @react-native-community/slider |
| 67 | + cd android |
| 68 | + ./gradlew app:assembleRelease --stacktrace --info |
| 69 | +
|
| 70 | + - name: Upload APK |
| 71 | + uses: actions/upload-artifact@v2 |
| 72 | + with: |
| 73 | + name: 'AndroidAPK' |
| 74 | + path: Playground/android/app/build/outputs/apk/release/app-release.apk |
| 75 | + |
| 76 | + build-ios: |
| 77 | + runs-on: macos-latest |
| 78 | + steps: |
| 79 | + - name: Checkout Repo |
| 80 | + uses: actions/checkout@v2.3.3 |
| 81 | + - name: Clone iOS Toolchain |
| 82 | + run: | |
| 83 | + git clone https://github.com/leetal/ios-cmake.git |
| 84 | + - name: Build Playground iOS |
| 85 | + run: | |
| 86 | + brew install node |
| 87 | + brew install watchman |
| 88 | + npm uninstall -g react-native-cli @react-native-community/cli |
| 89 | + npx react-native init Playground --version "${{ github.event.inputs.RN_Version }}" --verbose --skip-install |
| 90 | + cp Apps/Playground/playground-shared/App.tsx ./Playground/App.tsx |
| 91 | + cd Playground |
| 92 | + yarn install |
| 93 | + npm install @babylonjs/core |
| 94 | + npm install @babylonjs/loaders |
| 95 | + npm install @babylonjs/react-native@${{ github.event.inputs.BRN_Version }} |
| 96 | + npm install @babylonjs/react-native-iosandroid-${{ github.event.inputs.BRN_Postfix }}@${{ github.event.inputs.BRN_Version }} |
| 97 | + npm install @react-native-community/slider |
| 98 | + cd ios |
| 99 | + pod install |
| 100 | + #xcodebuild -sdk iphoneos -configuration Release -workspace Playground.xcworkspace -scheme Playground build CODE_SIGNING_ALLOWED=NO |
| 101 | + xcodebuild -sdk iphonesimulator -arch x86_64 -configuration Release -workspace Playground.xcworkspace -scheme Playground build CODE_SIGNING_ALLOWED=NO -archivePath ./playgroundSimulator.xcarchive archive |
| 102 | +
|
| 103 | + - name: Upload iOS App |
| 104 | + uses: actions/upload-artifact@v2 |
| 105 | + with: |
| 106 | + name: 'iOSApp' |
| 107 | + path: Playground/ios/playgroundSimulator.xcarchive |
| 108 | + |
| 109 | +# test jobs not working |
| 110 | +# test-android: |
| 111 | +# needs: [build-android] |
| 112 | +# runs-on: macos-latest |
| 113 | +# steps: |
| 114 | +# - name: Download APK |
| 115 | +# uses: actions/download-artifact@v2 |
| 116 | +# with: |
| 117 | +# name: 'AndroidAPK' |
| 118 | +# path: ./ |
| 119 | +# - name: Install Android Emulator |
| 120 | +# run: | |
| 121 | +# echo Install Android image |
| 122 | +# echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install "system-images;android-27;default;x86_64" |
| 123 | +# echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --licenses |
| 124 | +# echo Create AVD |
| 125 | +# $ANDROID_HOME/tools/bin/avdmanager create avd -n Pixel_API_27 -d pixel -k "system-images;android-27;default;x86_64" |
| 126 | +# |
| 127 | +# - name: Start emulator |
| 128 | +# run: | |
| 129 | +# echo Start emulator |
| 130 | +# nohup $ANDROID_HOME/emulator/emulator -avd Pixel_API_27 -gpu host -no-audio -no-boot-anim -camera-back none -camera-front none -qemu -m 2048 2>&1 & |
| 131 | +# echo Wait for emulator |
| 132 | +# adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do echo "."; sleep 1; done; input keyevent 82' |
| 133 | +# adb devices |
| 134 | +# adb install -t ./app-release.apk |
| 135 | +# echo APK installation done. |
| 136 | +# adb wait-for-device shell am start -n com.playground/com.playground.MainActivity |
| 137 | +# echo Activity started. |
| 138 | +# adb wait-for-device shell pidof com.playground |
| 139 | +# echo Activity PID |
| 140 | +# adb wait-for-device shell while [[ -z $(pidof com.playground | tr -d "\r") ]]; do echo "."; sleep 1; done; input keyevent 82 |
| 141 | +# echo Activity is running. Waiting 10s. |
| 142 | +# sleep 10 |
| 143 | +# echo Checking it's still alive |
| 144 | +# if [[ -z "$(pidof com.playground | tr -d '\r')" ]]; then echo "com.playground is not running."; exit 1; fi |
| 145 | +# echo Checks done. |
0 commit comments