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
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ runs:
path: |
**/node_modules
.yarn/install-state.gz
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}-${{ hashFiles('**/patches/*.patch', '!node_modules/**') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
${{ runner.os }}-yarn-
Expand Down
108 changes: 97 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Setup
uses: ./.github/actions/setup
Expand All @@ -36,7 +36,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Setup
uses: ./.github/actions/setup
Expand All @@ -48,7 +48,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Setup
uses: ./.github/actions/setup
Expand All @@ -67,7 +67,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Setup
uses: ./.github/actions/setup
Expand Down Expand Up @@ -196,7 +196,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Setup
uses: ./.github/actions/setup
Expand All @@ -211,7 +211,7 @@ jobs:

- name: Check turborepo cache for Android (${{ matrix.features }})
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")
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --filter=@preeternal/react-native-document-scanner-plugin-example --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
Expand Down Expand Up @@ -246,16 +246,19 @@ jobs:
JAVA_OPTS: "-XX:MaxHeapSize=6g"
ORG_GRADLE_PROJECT_DocumentScanner_analysisFeatures: ${{ matrix.features }}
run: |
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
yarn turbo run build:android --filter=@preeternal/react-native-document-scanner-plugin-example --cache-dir="${{ env.TURBO_CACHE_DIR }}"

build-ios:
runs-on: macos-26
runs-on: macos-latest
env:
XCODE_VERSION: latest-stable
TURBO_CACHE_DIR: .turbo/ios
RCT_REMOVE_LEGACY_ARCH: 1
RCT_USE_RN_DEP: 1
RCT_USE_PREBUILT_RNCORE: 1
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Setup
uses: ./.github/actions/setup
Expand All @@ -270,7 +273,7 @@ jobs:

- 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")
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:ios --filter=@preeternal/react-native-document-scanner-plugin-example --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
Expand All @@ -294,7 +297,7 @@ jobs:
run: |
set -euo pipefail
IOS_BUILD_LOG="$RUNNER_TEMP/ios-build.log"
if ! yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" 2>&1 | tee "$IOS_BUILD_LOG"; then
if ! yarn turbo run build:ios --filter=@preeternal/react-native-document-scanner-plugin-example --cache-dir="${{ env.TURBO_CACHE_DIR }}" 2>&1 | tee "$IOS_BUILD_LOG"; then
echo "::group::First iOS errors"
grep -nE " error: |fatal error:|Command PhaseScriptExecution failed|No such file|cannot find type " \
"$IOS_BUILD_LOG" | head -n 80 || true
Expand All @@ -309,3 +312,86 @@ jobs:
name: ios-build-log
if-no-files-found: warn
path: ${{ runner.temp }}/ios-build.log

build-android-rn87:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

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

- name: Install JDK
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
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@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
~/.gradle/wrapper
~/.gradle/caches
key: ${{ runner.os }}-gradle-rn87-${{ hashFiles('example-spm/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-rn87-
${{ runner.os }}-gradle-

- name: Build RN 0.87 example for Android
env:
JAVA_OPTS: "-XX:MaxHeapSize=6g"
ORG_GRADLE_PROJECT_DocumentScanner_analysisFeatures: all
run: yarn example:spm build:android

build-ios-spm-rn87:
runs-on: macos-latest
env:
XCODE_VERSION: latest-stable
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

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

- name: Use appropriate Xcode version
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: ${{ env.XCODE_VERSION }}

- name: Cache React Native SwiftPM artifacts
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/Library/Caches/ReactNative/spm-artifacts
key: ${{ runner.os }}-react-native-spm-${{ hashFiles('example-spm/package.json') }}
restore-keys: |
${{ runner.os }}-react-native-spm-

- name: Generate SwiftPM integration
run: yarn example:spm spm:setup

- name: Build RN 0.87 SwiftPM example for iOS
run: |
set -euo pipefail
IOS_BUILD_LOG="$RUNNER_TEMP/ios-spm-build.log"
if ! yarn example:spm build:ios 2>&1 | tee "$IOS_BUILD_LOG"; then
echo "::group::First iOS SwiftPM errors"
grep -nE " error: |fatal error:|Command PhaseScriptExecution failed|No such file|cannot find type " \
"$IOS_BUILD_LOG" | head -n 80 || true
echo "::endgroup::"
exit 1
fi

- name: Upload iOS SwiftPM build log
if: always()
uses: actions/upload-artifact@v4
with:
name: ios-spm-rn87-build-log
if-no-files-found: warn
path: ${{ runner.temp }}/ios-spm-build.log
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jsconfig.json
# Xcode
#
build/
/.build/
*.pbxuser
!default.pbxuser
*.mode1v3
Expand Down Expand Up @@ -87,3 +88,6 @@ nitrogen/

#Temp files
*.tmp

# Tests
coverage/
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v22.18.0
v24.13.0
Loading
Loading