Skip to content

Commit

Permalink
CMP-3794 - Update React-Native version (#133)
Browse files Browse the repository at this point in the history
* CMP-3794 re create sample and test apps (#126)

* update gradle wrapper

* update build config for API 34

* create new app for sample

* remove old app for sample

* replace `yarn` by `npm` from worflows

* cleanup code

* create new test app

* remove old test app

* Update iOS schemes and target

* update UI tests assertion + clean unused vars

* update iOS jobs (use iPhone 15 / macOS 14)

* android workflow: add JDK 17 + fix android build

* use gcloud beta + update test parameters

* add missing empty line

* merge vendor count methods

* CMP-3794 - Update SDK (#128)

* update AGP / Kotlin

* update package name / clean code

* update SDK dependencies (use RN 0.73.8)

* update Didomi SDK listeners

* use branch name as results history name for Firebase jobs

* fix Didomi module

* revert Didomi module `getConstants` function

* CMP-3794 - Update apps (#129)

* `sample` and `test` apps update from Xcode

* Update Sample app name

* setup mavenLocal (#130)

* remove scripts and unused plugins from package file (#131)

* fix repository url (#132)

* CMP-3794 - Update md files (#134)

* update `readme`

* update `contributing`

* fix indent
  • Loading branch information
nicolas-chaix-didomi authored Aug 21, 2024
1 parent f19f93f commit 90b94df
Show file tree
Hide file tree
Showing 264 changed files with 3,830 additions and 5,559 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,30 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4

- name: Cache Node dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: yarn install
- run: yarn prepare
- run: npm publish --access public

- name: Install dependencies
run: npm install

- name: Prepare and publish
run: |
npm run prepare
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
58 changes: 35 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,37 +24,43 @@ jobs:
with:
node-version: 20

- name: Cache node dependencies
- name: Cache Node dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: yarn install

run: npm install
- name: Run JS tests
run: yarn test
run: npm test

test_android:
name: Testing Android
needs: test_js
runs-on: ubuntu-latest
defaults:
run:
working-directory: testApp
working-directory: test
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Cache node dependencies
- name: Cache Node dependencies
uses: actions/cache@v4
with:
path: ~/.npm
Expand All @@ -63,7 +69,7 @@ jobs:
${{ runner.os }}-node-
- name: Install dependencies
run: yarn install
run: npm install

- name: Cache Gradle Wrapper
uses: actions/cache@v4
Expand All @@ -84,14 +90,14 @@ jobs:

- name: Build Android App
run: |
npx react-native bundle --platform android --dev false --entry-file index.tsx --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
cd android && ./gradlew assembleDebug --no-daemon
- name: Upload Android App APK
uses: actions/upload-artifact@v4
with:
name: app-debug.apk
path: testApp/android/app/build/outputs/apk/debug/app-debug.apk
path: test/android/app/build/outputs/apk/debug/app-debug.apk

- name: Build Android Test
run: |
Expand All @@ -101,7 +107,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: app-debug-androidTest.apk
path: testApp/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk
path: test/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk

# Authenticate Cloud SDK
- id: 'auth'
Expand All @@ -113,23 +119,29 @@ jobs:
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ secrets.FIREBASE_PROJECT_ID }}
install_components: 'beta'

- name: Run Instrumentation Tests in Firebase Test Lab
run: |
gcloud firebase test android run --type instrumentation \
--app android/app/build/outputs/apk/debug/app-debug.apk \
--test android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk \
gcloud beta firebase test android run \
--type=instrumentation \
--app=android/app/build/outputs/apk/debug/app-debug.apk \
--test=android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk \
--device="model=MediumPhone.arm,version=34,locale=en,orientation=portrait" \
--test-targets="package io.didomi.reactnative.test" \
--results-history-name="${{ github.ref_name }}" \
--num-flaky-test-attempts=3 \
--num-uniform-shards=3 \
--use-orchestrator \
--device model=MediumPhone.arm,version=33,locale=en,orientation=portrait \
--num-flaky-test-attempts=3
--quiet
test_ios:
name: Testing iOS
needs: test_js
runs-on: macos-12
runs-on: macos-14
defaults:
run:
working-directory: testApp
working-directory: test
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -140,7 +152,7 @@ jobs:
node-version: 20
registry-url: 'https://registry.npmjs.org'

- name: Cache node dependencies
- name: Cache Node dependencies
uses: actions/cache@v4
with:
path: ~/.npm
Expand All @@ -149,7 +161,7 @@ jobs:
${{ runner.os }}-node-
- name: Install dependencies
run: yarn install
run: npm install

- name: Install pods
run: cd ios && pod install
Expand All @@ -160,10 +172,10 @@ jobs:
npx react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios/assets
rm index.js
cd ios && TEST=1 && RCT_NO_LAUNCH_PACKAGER=1 xcodebuild \
-workspace DidomiExample.xcworkspace \
-scheme DidomiExample \
-workspace "Didomi Tests.xcworkspace" \
-scheme "Didomi Tests" \
-sdk iphonesimulator \
-destination "platform=iOS Simulator,name=iPhone 11" \
-destination "platform=iOS Simulator,name=iPhone 15" \
clean test
release:
Expand Down
Loading

0 comments on commit 90b94df

Please sign in to comment.