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
31 changes: 22 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,27 +70,30 @@ jobs:
${{ runner.os }}-turborepo-android-

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

if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
echo "hit=true" >> $GITHUB_OUTPUT
else
echo "hit=false" >> $GITHUB_OUTPUT
fi

- name: Install JDK
if: env.turbo_cache_hit != 1
if: steps.check-turbo-cache.outputs.hit != 'true'
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "17"

- name: Finalize Android SDK
if: env.turbo_cache_hit != 1
if: steps.check-turbo-cache.outputs.hit != 'true'
run: |
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"

- name: Cache Gradle
if: env.turbo_cache_hit != 1
if: steps.check-turbo-cache.outputs.hit != 'true'
uses: actions/cache@v3
with:
path: |
Expand Down Expand Up @@ -128,15 +131,18 @@ jobs:
${{ runner.os }}-turborepo-ios-

- name: Check turborepo cache for iOS
id: check-turbo-cache
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
echo "hit=true" >> $GITHUB_OUTPUT
else
echo "hit=false" >> $GITHUB_OUTPUT
fi

- name: Cache cocoapods
if: env.turbo_cache_hit != 1
if: steps.check-turbo-cache.outputs.hit != 'true'
id: cocoapods-cache
uses: actions/cache@v3
with:
Expand All @@ -147,14 +153,21 @@ jobs:
${{ runner.os }}-cocoapods-

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

- name: Generate Podfile.lock for caching
if: steps.check-turbo-cache.outputs.hit != 'true' &&
steps.cocoapods-cache.outputs.cache-hit != 'true'
run: |
cd example/ios
pod install

- name: Build example for iOS
run: |
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
3 changes: 3 additions & 0 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ require "#{ws_dir}/node_modules/react-native-test-app/test_app.rb"
workspace 'ZebraLinkosExample.xcworkspace'

use_test_app!

# Explicitly include the native module
pod 'react-native-zebra-linkos', :path => '../..'
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"android": "react-native run-android",
"build:android": "npm run mkdist && react-native bundle --entry-file index.js --platform android --dev true --bundle-output dist/main.android.jsbundle --assets-dest dist && react-native build-android --extra-params \"--no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a\"",
"build:ios": "npm run mkdist && react-native bundle --entry-file index.js --platform ios --dev true --bundle-output dist/main.ios.jsbundle --assets-dest dist && react-native build-ios --scheme RnScheduleClearCacheExample --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\"",
"build:ios": "npm run mkdist && react-native bundle --entry-file index.js --platform ios --dev true --bundle-output dist/main.ios.jsbundle --assets-dest dist && cd ios && xcodebuild -workspace ZebraLinkosExample.xcworkspace -configuration Debug -scheme ZebraLinkosExample -destination 'generic/platform=iOS Simulator' -sdk iphonesimulator COMPILER_INDEX_STORE_ENABLE=NO",
"ios": "react-native run-ios",
"mkdist": "node -e \"require('node:fs').mkdirSync('dist', { recursive: true, mode: 0o755 })\"",
"start": "react-native start"
Expand Down
Loading