From f2b90199146327699d252ecbcb7fb7e7ca0e101c Mon Sep 17 00:00:00 2001 From: Kilian Finger Date: Sun, 8 Dec 2024 08:39:01 +0100 Subject: [PATCH 1/7] fix: use old arch for RN example --- packages/react-native-app/ios/Podfile | 2 + packages/react-native-app/ios/Podfile.lock | 111 +++------------------ 2 files changed, 14 insertions(+), 99 deletions(-) diff --git a/packages/react-native-app/ios/Podfile b/packages/react-native-app/ios/Podfile index 644fc3ed6..f337153f6 100644 --- a/packages/react-native-app/ios/Podfile +++ b/packages/react-native-app/ios/Podfile @@ -1,3 +1,5 @@ +ENV['RCT_NEW_ARCH_ENABLED'] ||= '0' + # Resolve react_native_pods.rb with node to allow for hoisting require Pod::Executable.execute_command('node', ['-p', 'require.resolve( diff --git a/packages/react-native-app/ios/Podfile.lock b/packages/react-native-app/ios/Podfile.lock index a2a4acecd..9732bb568 100644 --- a/packages/react-native-app/ios/Podfile.lock +++ b/packages/react-native-app/ios/Podfile.lock @@ -1250,71 +1250,7 @@ PODS: - ReactCommon/turbomodule/core - Yoga - react-native-safe-area-context (4.14.0): - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly (= 2024.01.01.00) - - RCTRequired - - RCTTypeSafety - - React-Core - - React-debug - - React-Fabric - - React-featureflags - - React-graphics - - React-ImageManager - - react-native-safe-area-context/common (= 4.14.0) - - react-native-safe-area-context/fabric (= 4.14.0) - - React-NativeModulesApple - - React-RCTFabric - - React-rendererdebug - - React-utils - - ReactCodegen - - ReactCommon/turbomodule/bridging - - ReactCommon/turbomodule/core - - Yoga - - react-native-safe-area-context/common (4.14.0): - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly (= 2024.01.01.00) - - RCTRequired - - RCTTypeSafety - - React-Core - - React-debug - - React-Fabric - - React-featureflags - - React-graphics - - React-ImageManager - - React-NativeModulesApple - - React-RCTFabric - - React-rendererdebug - - React-utils - - ReactCodegen - - ReactCommon/turbomodule/bridging - - ReactCommon/turbomodule/core - - Yoga - - react-native-safe-area-context/fabric (4.14.0): - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly (= 2024.01.01.00) - - RCTRequired - - RCTTypeSafety - React-Core - - React-debug - - React-Fabric - - React-featureflags - - React-graphics - - React-ImageManager - - react-native-safe-area-context/common - - React-NativeModulesApple - - React-RCTFabric - - React-rendererdebug - - React-utils - - ReactCodegen - - ReactCommon/turbomodule/bridging - - ReactCommon/turbomodule/core - - Yoga - React-nativeconfig (0.76.3) - React-NativeModulesApple (0.76.3): - glog @@ -1625,29 +1561,6 @@ PODS: - ReactCommon/turbomodule/core - Yoga - RNScreens (3.35.0): - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly (= 2024.01.01.00) - - RCTRequired - - RCTTypeSafety - - React-Core - - React-debug - - React-Fabric - - React-featureflags - - React-graphics - - React-ImageManager - - React-NativeModulesApple - - React-RCTFabric - - React-RCTImage - - React-rendererdebug - - React-utils - - ReactCodegen - - ReactCommon/turbomodule/bridging - - ReactCommon/turbomodule/core - - RNScreens/common (= 3.35.0) - - Yoga - - RNScreens/common (3.35.0): - DoubleConversion - glog - hermes-engine @@ -1905,16 +1818,16 @@ SPEC CHECKSUMS: React-CoreModules: 291be650024d9db086c95fd1d7e7d9607c6de62b React-cxxreact: 5cf17d13ca0fc0734e1bb0ed9615d1d1fc45ef78 React-debug: 931ca94abd6b1bcab539e356e20df788afecae8f - React-defaultsnativemodule: 6afc2dd3619bac12dc54c1ee939bf14f9aa96b42 - React-domnativemodule: f140d46f6f3c3f1efc987c98b464fcbece0cc93a + React-defaultsnativemodule: fa1917ffdbb17e2a03f9a2b26e6f7342f59662c0 + React-domnativemodule: c9dcbf0a872f3d02210f005c084d0fc1fdb83f2d React-Fabric: e1774fe4b579e34c2c5721e9351c8ce869e7b5f0 React-FabricComponents: 528ff9f96d150379ed404221d70cc7019ca76865 React-FabricImage: 31680b7ddc740e040277176fbd6541fcf0fd44af React-featureflags: 7c7a74b65ee5a228f520b387ebfe0e8d9cecc622 - React-featureflagsnativemodule: dd3450366b1c9557975e457ce6baa151ccee84da + React-featureflagsnativemodule: bc298d49634a5b2e0576b9bda6a0dc337ef158f8 React-graphics: 7f0d3e06d356e8476bd8ba95d90762fc01138ebc React-hermes: f83fafe6a1c845dace7abad4a5d7366cbb42ab96 - React-idlecallbacksnativemodule: 14ce331438e2bca7d464a8a211b14543aff4dc91 + React-idlecallbacksnativemodule: 733deb5f645226868cf49a0eb798c62082a3fb34 React-ImageManager: 2b9274ea973f43597a554a182d7ef525836172c6 React-jserrorhandler: 3b521485275d295cfc6ec6bfa921a1d608693ecf React-jsi: fd23c1d759feb709784fd4c835b510b90a94dd12 @@ -1923,17 +1836,17 @@ SPEC CHECKSUMS: React-jsitracing: 11b6646d7b2ecdc7a475f65b2cb12d3805964195 React-logger: 26155dc23db5c9038794db915f80bd2044512c2e React-Mapbuffer: ad1ba0205205a16dbff11b8ade6d1b3959451658 - React-microtasksnativemodule: e771eb9eb6ace5884ee40a293a0e14a9d7a4343c - react-native-safe-area-context: 2500e4fe998caad50ad3bc51ec23ef951308569e + React-microtasksnativemodule: 36e3a415c6a3a5c4784b5c6bad38013b8ca35be4 + react-native-safe-area-context: 4532f1a0c5d34a46b9324ccaaedcb5582a302b7d React-nativeconfig: aeed6e2a8ac02b2df54476afcc7c663416c12bf7 React-NativeModulesApple: c5b7813da94136f50ef084fa1ac077332dcfc658 React-perflogger: 6afb7eebf7d9521cc70481688ccddf212970e9d3 React-performancetimeline: 81884d35896b22d51832e7c8748c8330ec73c491 React-RCTActionSheet: c940a35d71686941ac2b96dd07bde11ea0f0c34f React-RCTAnimation: e1dbb4e530d6f58437ab2fae372de3788ecdffab - React-RCTAppDelegate: f9825950ac2c52ae1cf46b648bb362b86b62fe41 + React-RCTAppDelegate: 3aa8a7b8bff5afcc00f947471c2fc93bd2093de5 React-RCTBlob: 9cdac4721a76e2d132fb1760eafd0a8f150d1c96 - React-RCTFabric: c0aa01a448bcebb1326d068ed7545eb11561e663 + React-RCTFabric: b833ecb9bb715858731f658accae0804bd2f4a7b React-RCTImage: f09f5165807e1a69a2bbac6c7168a8ed57ed4e26 React-RCTLinking: 4ea06b79cba7e15d8af4d86b1dcede6bd29a47fd React-RCTNetwork: 43a38148c7a4a2380e76b08f07f02ee8eaac8965 @@ -1952,12 +1865,12 @@ SPEC CHECKSUMS: React-utils: 2bcaf4f4dfe361344bce2fae428603d518488630 ReactCodegen: ae99a130606068ed40d1d9c0d5f25fda142a0647 ReactCommon: 89c87b343deacc8610b099ac764848f0ce937e3e - RNCMaskedView: c22a01dd2d0744c16b56e06eb8720512b900988c - RNGestureHandler: 0e5ae8d72ef4afb855e98dcdbe60f27d938abe13 - RNScreens: e389d6a6a66a4f0d3662924ecae803073ccce8ec + RNCMaskedView: e07a0b5e9e8d6962826def06e6ff2ecdb815433f + RNGestureHandler: aa9690789023c9be8f06aa90e10ce637ea788f4d + RNScreens: c7ceced6a8384cb9be5e7a5e88e9e714401fd958 SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 Yoga: 3deb2471faa9916c8a82dda2a22d3fba2620ad37 -PODFILE CHECKSUM: 1c7a14209e2b40f062b64b661237d5303242d15f +PODFILE CHECKSUM: 06b1adb009c99d5e9b6919686a41bf1656ce30c3 COCOAPODS: 1.16.2 From b7b06327507d48828fd431747a9edf44852c7e35 Mon Sep 17 00:00:00 2001 From: Kilian Finger Date: Sun, 8 Dec 2024 08:39:05 +0100 Subject: [PATCH 2/7] chore: fix typo --- packages/react-native-app/ios/Podfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-app/ios/Podfile b/packages/react-native-app/ios/Podfile index f337153f6..e3b009bf1 100644 --- a/packages/react-native-app/ios/Podfile +++ b/packages/react-native-app/ios/Podfile @@ -10,7 +10,7 @@ require Pod::Executable.execute_command('node', ['-p', platform :ios, min_ios_version_supported prepare_react_native_project! -# We ingore warning except for MLRN +# We ignore warning except for MLRN INHIBIT_WARNING_BY_DEFAULT = true if INHIBIT_WARNING_BY_DEFAULT From 63bf3fb8b863a1dd86d101eb1b3d16bdead4bdc9 Mon Sep 17 00:00:00 2001 From: Kilian Finger Date: Sun, 8 Dec 2024 09:17:23 +0100 Subject: [PATCH 3/7] ci: separate Android and iOS workflow for arch matrix --- .github/workflows/review-android.yml | 125 ++++++++++++++++ .github/workflows/review-ios.yml | 98 ++++++++++++ .github/workflows/review.yml | 214 +-------------------------- 3 files changed, 230 insertions(+), 207 deletions(-) create mode 100644 .github/workflows/review-android.yml create mode 100644 .github/workflows/review-ios.yml diff --git a/.github/workflows/review-android.yml b/.github/workflows/review-android.yml new file mode 100644 index 000000000..a71e18b94 --- /dev/null +++ b/.github/workflows/review-android.yml @@ -0,0 +1,125 @@ +name: Android + +on: + workflow_call: + # Review calls this Workflow + +jobs: + build-android: + name: Build Android + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./packages/react-native-app + strategy: + matrix: + new-arch: [false, true] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup + uses: ./.github/actions/setup + + - name: Setup Azul Zulu OpenJDK + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 21 + cache: gradle + + - name: Cache Android Build + uses: actions/cache@v4 + id: android-build-cache + with: + path: | + ./android/build + ./packages/react-native-app/android/.gradle + ./packages/react-native-app/android/app/build + ./packages/react-native-app/android/build + key: ${{ runner.os }}-android-build-${{ matrix.new-arch && 'new-arch' || 'old-arch' }}-${{ github.workflow }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-android-build-${{ matrix.new-arch && 'new-arch' || 'old-arch' }}-${{ github.workflow }}-${{ github.sha }} + ${{ runner.os }}-android-build-${{ matrix.new-arch && 'new-arch' || 'old-arch' }}-${{ github.workflow }}- + + - name: Build Android + if: steps.android-build-cache.outputs.cache-hit != 'true' + run: yarn react-native build-android --mode release --tasks assembleRelease --extra-params "-PnewArchEnabled=${{ matrix.new-arch }}" + + - name: Upload Android App + uses: actions/upload-artifact@v4 + with: + name: android-app + path: ./packages/react-native-app/android/app/build/outputs/apk/release/app-release.apk + + test-android: + name: Test Android + needs: [build-android] + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./packages/react-native-app + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Enable KVM Group Permissions + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + + - name: Gradle cache + uses: gradle/actions/setup-gradle@v3 + + - name: Cache Android Virtual Device + uses: actions/cache@v4 + id: android-virtual-device-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: android-virtual-device-api-level-33 + + - name: Create Android Virtual Device + if: steps.android-virtual-device-cache.outputs.cache-hit != 'true' + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: 33 + target: google_apis + arch: x86_64 + force-avd-creation: false + working-directory: ./packages/react-native-app + script: echo "Generated Android Virtual Device Snapshot for Caching" + + - name: Install Maestro + run: | + curl -Ls "https://get.maestro.mobile.dev" | bash + echo "$HOME/.maestro/bin" >> "$GITHUB_PATH" + + - name: Download Android App + uses: actions/download-artifact@v4 + with: + name: android-app + path: ./packages/react-native-app/android/ + + - name: Test Android + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: 33 + target: google_apis + arch: x86_64 + force-avd-creation: false + working-directory: ./packages/react-native-app + script: | + adb install ./android/app-release.apk + maestro test ./e2e/show-map.yml --format junit + + - name: Upload Android Report + if: always() + uses: actions/upload-artifact@v4 + with: + name: Android Report + path: | + ./packages/react-native-app/report.xml + ~/.maestro/tests/**/* diff --git a/.github/workflows/review-ios.yml b/.github/workflows/review-ios.yml new file mode 100644 index 000000000..bd145f934 --- /dev/null +++ b/.github/workflows/review-ios.yml @@ -0,0 +1,98 @@ +name: iOS + +on: + workflow_call: + # Review calls this Workflow + +jobs: + build-ios: + name: Build iOS + runs-on: macos-latest + defaults: + run: + working-directory: ./packages/react-native-app + strategy: + matrix: + new-arch: [false, true] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup + uses: ./.github/actions/setup + + - name: Cache Cocoapods + uses: actions/cache@v4 + id: cocoapods-cache + with: + path: ./packages/react-native-app/ios/Pods + key: ${{ runner.os }}-cocoapods-${{ matrix.new-arch && 'new-arch' || 'old-arch' }}-${{ hashFiles('./packages/react-native-app/ios/Podfile.lock') }} + restore-keys: | + ${{ runner.os }}-cocoapods-${{ matrix.new-arch && 'new-arch' || 'old-arch' }}-${{ hashFiles('./packages/react-native-app/ios/Podfile.lock') }} + ${{ runner.os }}-cocoapods-${{ matrix.new-arch && 'new-arch' || 'old-arch' }}- + + - name: Install Cocoapods + if: steps.cocoapods-cache.outputs.cache-hit != 'true' + run: RCT_NEW_ARCH_ENABLED=${{ matrix.new-arch && '1' || '0' }} yarn pod:install + + - name: Cache iOS Build + uses: actions/cache@v4 + id: ios-build-cache + with: + path: ./packages/react-native-app/ios/build + key: ${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new-arch' || 'old-arch' }}-${{ github.workflow }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new-arch' || 'old-arch' }}-${{ github.workflow }}-${{ github.sha }} + ${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new-arch' || 'old-arch' }}-${{ github.workflow }}- + + - name: Build iOS + if: steps.ios-build-cache.outputs.cache-hit != 'true' + # Like `react-native build-ios --mode Release` but adapted for simulators + run: xcodebuild -workspace ios/MapLibreReactNativeExample.xcworkspace -scheme MapLibreReactNativeExample -configuration Release -sdk iphonesimulator -derivedDataPath ios/build + + - name: Upload iOS App + uses: actions/upload-artifact@v4 + with: + name: ios-app + # `.app` is a directory, so we have to archive one level above + path: | + ./packages/react-native-app/ios/build/Build/Products/Release-iphonesimulator + !./packages/react-native-app/ios/build/Build/Products/Release-iphonesimulator/** + ./packages/react-native-app/ios/build/Build/Products/Release-iphonesimulator/MapLibreReactNativeExample.app + + test-ios: + name: Test iOS + needs: [build-ios] + runs-on: macos-latest + defaults: + run: + working-directory: ./packages/react-native-app + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Maestro + run: | + curl -Ls "https://get.maestro.mobile.dev" | bash + echo "$HOME/.maestro/bin" >> "$GITHUB_PATH" + + - name: Download iOS App + uses: actions/download-artifact@v4 + with: + name: ios-app + path: ./packages/react-native-app/ios + + - name: Test iOS + run: | + xcrun simctl boot "iPhone 15 Pro" + xcrun simctl install booted ./ios/MapLibreReactNativeExample.app + maestro test ./e2e/show-map.yml --format junit + + - name: Upload iOS Report + if: always() + uses: actions/upload-artifact@v4 + with: + name: iOS Report + path: | + ./packages/react-native-app/report.xml + ~/.maestro/tests/**/* diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml index 17e0f448c..c93ce5fbf 100644 --- a/.github/workflows/review.yml +++ b/.github/workflows/review.yml @@ -2,7 +2,7 @@ name: Review on: workflow_call: - # Release calls this Workflow + # Release calls this Workflow pull_request: branches: - main @@ -87,210 +87,10 @@ jobs: - name: Build Library run: yarn prepack - build-android: - name: Build Android - needs: [lint-eslint, lint-tsc, test, codegen, build-library] - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./packages/react-native-app - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup - uses: ./.github/actions/setup - - - name: Setup Azul Zulu OpenJDK - uses: actions/setup-java@v4 - with: - distribution: zulu - java-version: 21 - cache: gradle - - - name: Cache Android Build - uses: actions/cache@v4 - id: android-build-cache - with: - path: | - ./android/build - ./packages/react-native-app/android/.gradle - ./packages/react-native-app/android/app/build - ./packages/react-native-app/android/build - key: ${{ runner.os }}-android-build--${{ github.workflow }}-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-android-build--${{ github.workflow }}-${{ github.sha }} - ${{ runner.os }}-android-build--${{ github.workflow }}- - - - name: Build Android - if: steps.android-build-cache.outputs.cache-hit != 'true' - run: yarn react-native build-android --mode release --tasks assembleRelease - - - name: Upload Android App - uses: actions/upload-artifact@v4 - with: - name: android-app - path: ./packages/react-native-app/android/app/build/outputs/apk/release/app-release.apk - - test-android: - name: Test Android - needs: [build-android] - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./packages/react-native-app - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Enable KVM Group Permissions - run: | - echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules - sudo udevadm control --reload-rules - sudo udevadm trigger --name-match=kvm - - - name: Gradle cache - uses: gradle/actions/setup-gradle@v3 - - - name: Cache Android Virtual Device - uses: actions/cache@v4 - id: android-virtual-device-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: android-virtual-device-api-level-33 - - - name: Create Android Virtual Device - if: steps.android-virtual-device-cache.outputs.cache-hit != 'true' - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: 33 - target: google_apis - arch: x86_64 - force-avd-creation: false - working-directory: ./packages/react-native-app - script: echo "Generated Android Virtual Device Snapshot for Caching" - - - name: Install Maestro - run: | - curl -Ls "https://get.maestro.mobile.dev" | bash - echo "$HOME/.maestro/bin" >> "$GITHUB_PATH" - - - name: Download Android App - uses: actions/download-artifact@v4 - with: - name: android-app - path: ./packages/react-native-app/android/ - - - name: Test Android - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: 33 - target: google_apis - arch: x86_64 - force-avd-creation: false - working-directory: ./packages/react-native-app - script: | - adb install ./android/app-release.apk - maestro test ./e2e/show-map.yml --format junit - - - name: Upload Android Report - if: always() - uses: actions/upload-artifact@v4 - with: - name: Android Report - path: | - ./packages/react-native-app/report.xml - ~/.maestro/tests/**/* - - build-ios: - name: Build iOS - needs: [lint-eslint, lint-tsc, test, codegen, build-library] - runs-on: macos-latest - timeout-minutes: 30 - defaults: - run: - working-directory: ./packages/react-native-app - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup - uses: ./.github/actions/setup - - - name: Cache Cocoapods - uses: actions/cache@v4 - id: cocoapods-cache - with: - path: ./packages/react-native-app/ios/Pods - key: ${{ runner.os }}-cocoapods-${{ hashFiles('./packages/react-native-app/ios/Podfile.lock') }} - restore-keys: | - ${{ runner.os }}-cocoapods-${{ hashFiles('./packages/react-native-app/ios/Podfile.lock') }} - ${{ runner.os }}-cocoapods- - - - name: Install Cocoapods - if: steps.cocoapods-cache.outputs.cache-hit != 'true' - run: yarn pod:install - - - name: Cache iOS Build - uses: actions/cache@v4 - id: ios-build-cache - with: - path: ./packages/react-native-app/ios/build - key: ${{ runner.os }}-ios-build--${{ github.workflow }}-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-ios-build--${{ github.workflow }}-${{ github.sha }} - ${{ runner.os }}-ios-build--${{ github.workflow }}- - - - name: Build iOS - if: steps.ios-build-cache.outputs.cache-hit != 'true' - # Like `react-native build-ios --mode Release` but adapted for simulators - run: xcodebuild -workspace ios/MapLibreReactNativeExample.xcworkspace -scheme MapLibreReactNativeExample -configuration Release -sdk iphonesimulator -derivedDataPath ios/build - - - name: Upload iOS App - uses: actions/upload-artifact@v4 - with: - name: ios-app - # `.app` is a directory, so we have to archive one level above - path: | - ./packages/react-native-app/ios/build/Build/Products/Release-iphonesimulator - !./packages/react-native-app/ios/build/Build/Products/Release-iphonesimulator/** - ./packages/react-native-app/ios/build/Build/Products/Release-iphonesimulator/MapLibreReactNativeExample.app - - test-ios: - name: Test iOS - needs: [build-ios] - runs-on: macos-latest - defaults: - run: - working-directory: ./packages/react-native-app - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Maestro - run: | - curl -Ls "https://get.maestro.mobile.dev" | bash - echo "$HOME/.maestro/bin" >> "$GITHUB_PATH" - - - name: Download iOS App - uses: actions/download-artifact@v4 - with: - name: ios-app - path: ./packages/react-native-app/ios - - - name: Test iOS - run: | - xcrun simctl boot "iPhone 15 Pro" - xcrun simctl install booted ./ios/MapLibreReactNativeExample.app - maestro test ./e2e/show-map.yml --format junit + review-android: + name: Review Android + uses: ./.github/workflows/review-android.yml - - name: Upload iOS Report - if: always() - uses: actions/upload-artifact@v4 - with: - name: iOS Report - path: | - ./packages/react-native-app/report.xml - ~/.maestro/tests/**/* + review-ios: + name: Review iOS + uses: ./.github/workflows/review-ios.yml From 064d1910e1ebd28006f71386480c4e997620a462 Mon Sep 17 00:00:00 2001 From: Kilian Finger Date: Sun, 8 Dec 2024 09:33:26 +0100 Subject: [PATCH 4/7] ci: adopt matrxi for tests --- .github/workflows/review-android.yml | 38 +++++++++++++------------- .github/workflows/review-ios.yml | 40 ++++++++++++++-------------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/.github/workflows/review-android.yml b/.github/workflows/review-android.yml index a71e18b94..86834406e 100644 --- a/.github/workflows/review-android.yml +++ b/.github/workflows/review-android.yml @@ -5,15 +5,15 @@ on: # Review calls this Workflow jobs: + strategy: + matrix: + new-arch: [ false, true ] build-android: - name: Build Android + name: Build ${{ matrix.new-arch && 'new' || 'old'}} Arch runs-on: ubuntu-latest defaults: run: working-directory: ./packages/react-native-app - strategy: - matrix: - new-arch: [false, true] steps: - name: Checkout uses: actions/checkout@v4 @@ -28,7 +28,7 @@ jobs: java-version: 21 cache: gradle - - name: Cache Android Build + - name: Cache Build uses: actions/cache@v4 id: android-build-cache with: @@ -37,23 +37,23 @@ jobs: ./packages/react-native-app/android/.gradle ./packages/react-native-app/android/app/build ./packages/react-native-app/android/build - key: ${{ runner.os }}-android-build-${{ matrix.new-arch && 'new-arch' || 'old-arch' }}-${{ github.workflow }}-${{ github.sha }} + key: ${{ runner.os }}-android-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ github.workflow }}-${{ github.sha }} restore-keys: | - ${{ runner.os }}-android-build-${{ matrix.new-arch && 'new-arch' || 'old-arch' }}-${{ github.workflow }}-${{ github.sha }} - ${{ runner.os }}-android-build-${{ matrix.new-arch && 'new-arch' || 'old-arch' }}-${{ github.workflow }}- + ${{ runner.os }}-android-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ github.workflow }}-${{ github.sha }} + ${{ runner.os }}-android-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ github.workflow }}- - - name: Build Android + - name: Build if: steps.android-build-cache.outputs.cache-hit != 'true' run: yarn react-native build-android --mode release --tasks assembleRelease --extra-params "-PnewArchEnabled=${{ matrix.new-arch }}" - - name: Upload Android App + - name: Upload App uses: actions/upload-artifact@v4 with: - name: android-app + name: android-app-${{ matrix.new-arch && 'new' || 'old' }}-arch path: ./packages/react-native-app/android/app/build/outputs/apk/release/app-release.apk test-android: - name: Test Android + name: Test needs: [build-android] runs-on: ubuntu-latest defaults: @@ -72,7 +72,7 @@ jobs: - name: Gradle cache uses: gradle/actions/setup-gradle@v3 - - name: Cache Android Virtual Device + - name: Cache Virtual Device uses: actions/cache@v4 id: android-virtual-device-cache with: @@ -81,7 +81,7 @@ jobs: ~/.android/adb* key: android-virtual-device-api-level-33 - - name: Create Android Virtual Device + - name: Create Virtual Device if: steps.android-virtual-device-cache.outputs.cache-hit != 'true' uses: reactivecircus/android-emulator-runner@v2 with: @@ -97,13 +97,13 @@ jobs: curl -Ls "https://get.maestro.mobile.dev" | bash echo "$HOME/.maestro/bin" >> "$GITHUB_PATH" - - name: Download Android App + - name: Download App uses: actions/download-artifact@v4 with: - name: android-app + name: android-app-${{ matrix.new-arch && 'new' || 'old' }}-arch path: ./packages/react-native-app/android/ - - name: Test Android + - name: Run Tests uses: reactivecircus/android-emulator-runner@v2 with: api-level: 33 @@ -115,11 +115,11 @@ jobs: adb install ./android/app-release.apk maestro test ./e2e/show-map.yml --format junit - - name: Upload Android Report + - name: Upload Report if: always() uses: actions/upload-artifact@v4 with: - name: Android Report + name: Android Report ${{ matrix.new-arch && 'new' || 'old' }} Arch path: | ./packages/react-native-app/report.xml ~/.maestro/tests/**/* diff --git a/.github/workflows/review-ios.yml b/.github/workflows/review-ios.yml index bd145f934..0c4056e63 100644 --- a/.github/workflows/review-ios.yml +++ b/.github/workflows/review-ios.yml @@ -5,15 +5,15 @@ on: # Review calls this Workflow jobs: + strategy: + matrix: + new-arch: [ false, true ] build-ios: - name: Build iOS + name: Build ${{ matrix.new-arch && 'new' || 'old'}} Arch runs-on: macos-latest defaults: run: working-directory: ./packages/react-native-app - strategy: - matrix: - new-arch: [false, true] steps: - name: Checkout uses: actions/checkout@v4 @@ -26,34 +26,34 @@ jobs: id: cocoapods-cache with: path: ./packages/react-native-app/ios/Pods - key: ${{ runner.os }}-cocoapods-${{ matrix.new-arch && 'new-arch' || 'old-arch' }}-${{ hashFiles('./packages/react-native-app/ios/Podfile.lock') }} + key: ${{ runner.os }}-cocoapods-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ hashFiles('./packages/react-native-app/ios/Podfile.lock') }} restore-keys: | - ${{ runner.os }}-cocoapods-${{ matrix.new-arch && 'new-arch' || 'old-arch' }}-${{ hashFiles('./packages/react-native-app/ios/Podfile.lock') }} - ${{ runner.os }}-cocoapods-${{ matrix.new-arch && 'new-arch' || 'old-arch' }}- + ${{ runner.os }}-cocoapods-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ hashFiles('./packages/react-native-app/ios/Podfile.lock') }} + ${{ runner.os }}-cocoapods-${{ matrix.new-arch && 'new' || 'old' }}-arch- - name: Install Cocoapods if: steps.cocoapods-cache.outputs.cache-hit != 'true' run: RCT_NEW_ARCH_ENABLED=${{ matrix.new-arch && '1' || '0' }} yarn pod:install - - name: Cache iOS Build + - name: Cache Build uses: actions/cache@v4 id: ios-build-cache with: path: ./packages/react-native-app/ios/build - key: ${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new-arch' || 'old-arch' }}-${{ github.workflow }}-${{ github.sha }} + key: ${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ github.workflow }}-${{ github.sha }} restore-keys: | - ${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new-arch' || 'old-arch' }}-${{ github.workflow }}-${{ github.sha }} - ${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new-arch' || 'old-arch' }}-${{ github.workflow }}- + ${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ github.workflow }}-${{ github.sha }} + ${{ runner.os }}-ios-build-${{ matrix.new-arch && 'new' || 'old' }}-arch-${{ github.workflow }}- - - name: Build iOS + - name: Build if: steps.ios-build-cache.outputs.cache-hit != 'true' # Like `react-native build-ios --mode Release` but adapted for simulators run: xcodebuild -workspace ios/MapLibreReactNativeExample.xcworkspace -scheme MapLibreReactNativeExample -configuration Release -sdk iphonesimulator -derivedDataPath ios/build - - name: Upload iOS App + - name: Upload App uses: actions/upload-artifact@v4 with: - name: ios-app + name: ios-app-${{ matrix.new-arch && 'new' || 'old' }}-arch # `.app` is a directory, so we have to archive one level above path: | ./packages/react-native-app/ios/build/Build/Products/Release-iphonesimulator @@ -61,7 +61,7 @@ jobs: ./packages/react-native-app/ios/build/Build/Products/Release-iphonesimulator/MapLibreReactNativeExample.app test-ios: - name: Test iOS + name: Test needs: [build-ios] runs-on: macos-latest defaults: @@ -76,23 +76,23 @@ jobs: curl -Ls "https://get.maestro.mobile.dev" | bash echo "$HOME/.maestro/bin" >> "$GITHUB_PATH" - - name: Download iOS App + - name: Download App uses: actions/download-artifact@v4 with: - name: ios-app + name: ios-app-${{ matrix.new-arch && 'new' || 'old' }}-arch path: ./packages/react-native-app/ios - - name: Test iOS + - name: Run Tests run: | xcrun simctl boot "iPhone 15 Pro" xcrun simctl install booted ./ios/MapLibreReactNativeExample.app maestro test ./e2e/show-map.yml --format junit - - name: Upload iOS Report + - name: Upload Report if: always() uses: actions/upload-artifact@v4 with: - name: iOS Report + name: iOS Report ${{ matrix.new-arch && 'new' || 'old' }} Arch path: | ./packages/react-native-app/report.xml ~/.maestro/tests/**/* From eb0fa785f879e96a30ecb7a88f91bf8afcda401b Mon Sep 17 00:00:00 2001 From: Kilian Finger Date: Sun, 8 Dec 2024 09:35:09 +0100 Subject: [PATCH 5/7] ci: move matrix to jobs --- .github/workflows/review-android.yml | 9 ++++++--- .github/workflows/review-ios.yml | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/review-android.yml b/.github/workflows/review-android.yml index 86834406e..87c78b333 100644 --- a/.github/workflows/review-android.yml +++ b/.github/workflows/review-android.yml @@ -5,15 +5,15 @@ on: # Review calls this Workflow jobs: - strategy: - matrix: - new-arch: [ false, true ] build-android: name: Build ${{ matrix.new-arch && 'new' || 'old'}} Arch runs-on: ubuntu-latest defaults: run: working-directory: ./packages/react-native-app + strategy: + matrix: + new-arch: [false, true] steps: - name: Checkout uses: actions/checkout@v4 @@ -59,6 +59,9 @@ jobs: defaults: run: working-directory: ./packages/react-native-app + strategy: + matrix: + new-arch: [false, true] steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/review-ios.yml b/.github/workflows/review-ios.yml index 0c4056e63..9c2f57999 100644 --- a/.github/workflows/review-ios.yml +++ b/.github/workflows/review-ios.yml @@ -5,15 +5,15 @@ on: # Review calls this Workflow jobs: - strategy: - matrix: - new-arch: [ false, true ] build-ios: name: Build ${{ matrix.new-arch && 'new' || 'old'}} Arch runs-on: macos-latest defaults: run: working-directory: ./packages/react-native-app + strategy: + matrix: + new-arch: [false, true] steps: - name: Checkout uses: actions/checkout@v4 @@ -67,6 +67,9 @@ jobs: defaults: run: working-directory: ./packages/react-native-app + strategy: + matrix: + new-arch: [false, true] steps: - name: Checkout uses: actions/checkout@v4 From 53bc0d5e7dadb889987c0374a41006fb2437a7e7 Mon Sep 17 00:00:00 2001 From: Kilian Finger Date: Sun, 8 Dec 2024 09:40:58 +0100 Subject: [PATCH 6/7] ci: shorten job names --- .github/workflows/review.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml index c93ce5fbf..75127694b 100644 --- a/.github/workflows/review.yml +++ b/.github/workflows/review.yml @@ -88,9 +88,9 @@ jobs: run: yarn prepack review-android: - name: Review Android + name: Android uses: ./.github/workflows/review-android.yml review-ios: - name: Review iOS + name: iOS uses: ./.github/workflows/review-ios.yml From 336186970e2a678d2206270d5b313e67286e2e4c Mon Sep 17 00:00:00 2001 From: Kilian Finger Date: Sun, 8 Dec 2024 09:46:12 +0100 Subject: [PATCH 7/7] ci: add matrix to test name --- .github/workflows/review-android.yml | 2 +- .github/workflows/review-ios.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/review-android.yml b/.github/workflows/review-android.yml index 87c78b333..ac91d7800 100644 --- a/.github/workflows/review-android.yml +++ b/.github/workflows/review-android.yml @@ -53,7 +53,7 @@ jobs: path: ./packages/react-native-app/android/app/build/outputs/apk/release/app-release.apk test-android: - name: Test + name: Test ${{ matrix.new-arch && 'new' || 'old'}} Arch needs: [build-android] runs-on: ubuntu-latest defaults: diff --git a/.github/workflows/review-ios.yml b/.github/workflows/review-ios.yml index 9c2f57999..b529df59c 100644 --- a/.github/workflows/review-ios.yml +++ b/.github/workflows/review-ios.yml @@ -61,7 +61,7 @@ jobs: ./packages/react-native-app/ios/build/Build/Products/Release-iphonesimulator/MapLibreReactNativeExample.app test-ios: - name: Test + name: Test ${{ matrix.new-arch && 'new' || 'old'}} Arch needs: [build-ios] runs-on: macos-latest defaults: