Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
merge_group:
types:
- checks_requested
Expand Down Expand Up @@ -110,51 +110,55 @@
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"

build-ios:
runs-on: macos-14
runs-on: macos-15
env:
TURBO_CACHE_DIR: .turbo/ios
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup

- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: '16.4'

- name: Cache turborepo for iOS
uses: actions/cache@v3
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-ios-

- name: Check turborepo cache for iOS
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status")

if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi

- name: Cache cocoapods
if: env.turbo_cache_hit != 1
id: cocoapods-cache
uses: actions/cache@v3
with:
path: |
**/ios/Pods
key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-cocoapods-

- name: Install cocoapods
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
if: env.turbo_cache_hit != 1
run: |
cd example/ios
pod install
env:
NO_FLIPPER: 1

- name: Build example for iOS
run: |
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
33 changes: 33 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,36 @@
with:
token: ${{ secrets.QLTY_COVERAGE_TOKEN }}
files: coverage/lcov.info

android-bridge-tests:
name: Android bridge unit tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup

- name: Install JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'

- name: Finalize Android SDK
run: |
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"

- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/wrapper
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties', 'android/build.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Run Android bridge unit tests
run: yarn example test:android
Comment on lines +54 to +84
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Contributions (in the form of issues or pull requests) are welcome!
* If you have a patch for a bug, or an implementation of a new feature, you're more than welcome to submit a pull request!
* If the pull request is for an outstanding issue, please include a link to that issue. Otherwise, there's no need to create a new issue; simply explain the purpose of the Pull Request in the body.

#### **Running tests**
* JS: `yarn test`
* Android bridge (JDK 17 and the Android SDK required): `yarn example test:android`

Thanks,
Team Iterable

1 change: 1 addition & 0 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"ios": "react-native run-ios",
"start": "react-native start",
"build:android": "react-native build-android --extra-params \"--no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a\"",
"test:android": "cd android && ./gradlew :iterable_react-native-sdk:testDebugUnitTest --no-daemon --console=plain",
"build:ios": "react-native build-ios --scheme ReactNativeSdkExample --mode Debug --extra-params \"-sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO\""
},
"dependencies": {
Expand Down
49 changes: 32 additions & 17 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,46 @@
"build:android": {
"env": ["ORG_GRADLE_PROJECT_newArchEnabled"],
"inputs": [
"../.github/workflows/ci.yml",
"../package.json",
"../android/**",
"!../android/build/**",
"!../android/.gradle/**",
"!../android/.cxx/**",
"../src/**/*.ts",
"../src/**/*.tsx",
"package.json",
"android",
"!android/build",
"src/*.ts",
"src/*.tsx",
"example/package.json",
"example/android",
"!example/android/.gradle",
"!example/android/build",
"!example/android/app/build"
"index.js",
"app.json",
"react-native.config.js",
"src/**/*.ts",
"src/**/*.tsx",
"android/**",
"!android/.gradle/**",
"!android/build/**",
"!android/app/build/**",
"!android/app/.cxx/**"
],
"outputs": []
},
"build:ios": {
"env": ["RCT_NEW_ARCH_ENABLED"],
"inputs": [
"../.github/workflows/ci.yml",
"../package.json",
"../*.podspec",
"../ios/**",
"../src/**/*.ts",
"../src/**/*.tsx",
"package.json",
"*.podspec",
"ios",
"src/*.ts",
"src/*.tsx",
"example/package.json",
"example/ios",
"!example/ios/build",
"!example/ios/Pods"
"index.js",
"app.json",
"react-native.config.js",
"src/**/*.ts",
"src/**/*.tsx",
"ios/**",
"!ios/build/**",
"!ios/Pods/**"
],
"outputs": [".turbo/cache"]
}
Expand Down
Loading