diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml new file mode 100644 index 00000000..ffb5e4bf --- /dev/null +++ b/.github/workflows/compatibility.yml @@ -0,0 +1,79 @@ +name: Compatibility + +on: + workflow_dispatch: + +jobs: + compatibility: + runs-on: macos-15 + concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.react-native-version }} + cancel-in-progress: true + strategy: + fail-fast: false + matrix: + react-native-version: + - '0.77.2' + - '0.78.2' + - '0.79.2' + - '0.80.0' + - '0.81.5' + - '0.82.1' + - '0.83.2' + + steps: + - name: Checkout SDK + uses: actions/checkout@v6 + with: + path: sdk + + - name: Setup Node + uses: actions/setup-node@v6 + with: + node-version: 20 + + - name: Setup Java + uses: actions/setup-java@v5 + with: + distribution: 'temurin' + java-version: '17' + + - name: Build SDK + working-directory: sdk + run: | + npm install + npm run prepare + npm pack + + - name: Create RN Project + run: | + npx @react-native-community/cli init CompatTest \ + --version ${{ matrix.react-native-version }} \ + --skip-git-init \ + --skip-install + + - name: Install Dependencies + working-directory: CompatTest + run: | + npm install + npm install ../sdk/didomi-react-native-*.tgz + + - name: Build Android + working-directory: CompatTest/android + run: | + chmod +x ./gradlew + ./gradlew assembleDebug --no-daemon + + - name: Install Pods + working-directory: CompatTest/ios + run: pod install + + - name: Build iOS + working-directory: CompatTest/ios + run: | + xcodebuild build \ + -workspace CompatTest.xcworkspace \ + -scheme CompatTest \ + -sdk iphonesimulator \ + -destination "platform=iOS Simulator,name=iPhone 16" \ + CODE_SIGNING_ALLOWED=NO diff --git a/.gitignore b/.gitignore index 2381a4ad..e676001e 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,10 @@ DerivedData *.xcuserstate **/.xcode.env.local +# VSCode +# +.vscode/ + # Android/IntelliJ # build/ diff --git a/package.json b/package.json index ee1f2c72..6c859382 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ }, "peerDependencies": { "react": "*", - "react-native": "*" + "react-native": ">=0.77.0" }, "jest": { "preset": "react-native", diff --git a/sample/android/gradle.properties b/sample/android/gradle.properties index db23bb69..a87e0e0c 100644 --- a/sample/android/gradle.properties +++ b/sample/android/gradle.properties @@ -32,7 +32,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 # your application. You should enable this flag either if you want # to write custom TurboModules/Fabric components OR use libraries that # are providing them. -newArchEnabled=true +newArchEnabled=false # Use this property to enable or disable the Hermes JS engine. # If set to false, you will be using JSC instead. diff --git a/test/android/app/src/androidTest/java/io/didomi/reactnative/test/BaseUITest.kt b/test/android/app/src/androidTest/java/io/didomi/reactnative/test/BaseUITest.kt index b9e78cb8..6682b8b1 100644 --- a/test/android/app/src/androidTest/java/io/didomi/reactnative/test/BaseUITest.kt +++ b/test/android/app/src/androidTest/java/io/didomi/reactnative/test/BaseUITest.kt @@ -41,7 +41,7 @@ open class BaseUITest { onView(matcher).perform(ScrollToAction(), click()) } - private fun scrollToItem(name: String) { + protected fun scrollToItem(name: String) { val matcher = withText(name.uppercase()) onView(matcher).perform(ScrollToAction()) } diff --git a/test/android/app/src/androidTest/java/io/didomi/reactnative/test/UIMethodsTest.kt b/test/android/app/src/androidTest/java/io/didomi/reactnative/test/UIMethodsTest.kt index 13ee9b8f..823476d9 100644 --- a/test/android/app/src/androidTest/java/io/didomi/reactnative/test/UIMethodsTest.kt +++ b/test/android/app/src/androidTest/java/io/didomi/reactnative/test/UIMethodsTest.kt @@ -101,7 +101,9 @@ class UIMethodsTest : BaseUITest() { @Test fun test_HidePreferences() { + scrollToItem("showPreferences Purposes") // Scroll to the next item to be able to check button's status testMethodCall("hidePreferences") + testLastEvent("on_hide_preferences") } @Test