diff --git a/.github/actions/setup_test_project/action.yml b/.github/actions/setup_test_project/action.yml index 0f652b6e..15cb69ff 100644 --- a/.github/actions/setup_test_project/action.yml +++ b/.github/actions/setup_test_project/action.yml @@ -28,15 +28,15 @@ runs: NODE_VERSION: ${{ inputs.NODE_VERSION }} IS_EXPO: ${{ inputs.IS_EXPO }} - - name: Initialize project default template - if: inputs.IS_EXPO != 'true' - run: npx react-native@latest init BlePlxExample --version ${{ inputs.REACT_NATIVE_VERSION }} --directory test_project --skip-install --verbose - shell: bash + # - name: Initialize project default template + # if: inputs.IS_EXPO != 'true' + # run: npx react-native@latest init BlePlxExample --version ${{ inputs.REACT_NATIVE_VERSION }} --directory test_project --skip-install --verbose + # shell: bash - - name: Initialize project expo template - if: inputs.IS_EXPO == 'true' - run: npx create-expo-app test_project -t expo-template-blank-typescript --no-install - shell: bash + # - name: Initialize project expo template + # if: inputs.IS_EXPO == 'true' + # run: npx create-expo-app test_project -t expo-template-blank-typescript --no-install + # shell: bash - name: Cache dependencies id: yarn-cache @@ -49,17 +49,17 @@ runs: ${{ runner.os }}-${{ inputs.REACT_NATIVE_VERSION }}-yarn-${{ hashFiles('**/yarn.lock') }} ${{ runner.os }}-${{ inputs.REACT_NATIVE_VERSION }}-yarn- - - name: Copy project files - run: node ./scripts/copyExampleProjectFiles.js - shell: bash - env: - REACT_NATIVE_VERSION: ${{ inputs.REACT_NATIVE_VERSION }} - BRANCH_NAME: ${{ github.head_ref || github.ref_name }} - IS_EXPO: ${{ inputs.IS_EXPO || 'false'}} + # - name: Copy project files + # run: node ./scripts/copyExampleProjectFiles.js + # shell: bash + # env: + # REACT_NATIVE_VERSION: ${{ inputs.REACT_NATIVE_VERSION }} + # BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + # IS_EXPO: ${{ inputs.IS_EXPO || 'false'}} - name: Install dependencies if: steps.yarn-cache.outputs.cache-hit != 'true' run: | - yarn install --cwd test_project --immutable + yarn install --cwd example --no-immutable yarn install shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05dd0273..5255827e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,12 +92,12 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: '11' + java-version: '17' - - name: Finalize Android SDK - if: env.turbo_cache_hit != 1 - run: | - /bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null" + # - name: Finalize Android SDK + # if: env.turbo_cache_hit != 1 + # run: | + # /bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null" - name: Cache Gradle if: env.turbo_cache_hit != 1 @@ -106,7 +106,7 @@ jobs: path: | ~/.gradle/wrapper ~/.gradle/caches - key: ${{ runner.os }}-${{ matrix.configurations.react_native_version }}-gradle-${{ hashFiles('test_project/android/gradle/wrapper/gradle-wrapper.properties') }} + key: ${{ runner.os }}-${{ matrix.configurations.react_native_version }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }} restore-keys: | ${{ runner.os }}-${{ matrix.configurations.react_native_version }}-gradle- @@ -161,19 +161,19 @@ jobs: with: path: | **/ios/Pods - key: ${{ runner.os }}-${{ matrix.configurations.react_native_version }}-cocoapods-${{ hashFiles('test_project/ios/Podfile.lock') }} + key: ${{ runner.os }}-${{ matrix.configurations.react_native_version }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }} restore-keys: | ${{ runner.os }}-${{ matrix.configurations.react_native_version }}-cocoapods- - name: Install cocoapods if: env.turbo_cache_hit != 1 run: | - cd test_project/ios + cd example/ios pod install --verbose env: NO_FLIPPER: 1 - - name: Build test_project for iOS + - name: Build example for iOS if: env.turbo_cache_hit != 1 run: | yarn turbo run test:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" @@ -218,7 +218,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: '11' + java-version: '17' - name: Finalize Android SDK if: env.turbo_cache_hit != 1 @@ -232,7 +232,7 @@ jobs: path: | ~/.gradle/wrapper ~/.gradle/caches - key: ${{ runner.os }}-${{ matrix.configurations.react_native_version }}-gradle-${{ hashFiles('test_project/android/gradle/wrapper/gradle-wrapper.properties') }} + key: ${{ runner.os }}-${{ matrix.configurations.react_native_version }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }} restore-keys: | ${{ runner.os }}-${{ matrix.configurations.react_native_version }}-gradle- diff --git a/package.json b/package.json index 4727598c..89894947 100644 --- a/package.json +++ b/package.json @@ -40,10 +40,10 @@ "release": "release-it", "example": "yarn --cwd example", "build:android": "cd example/android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a", - "test:android": "cd test_project/android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a", + "test:android": "cd example/android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a", "build:ios": "cd example/ios && xcodebuild -workspace BlePlxExample.xcworkspace -scheme BlePlxExample -configuration Debug -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", - "test:ios": "cd test_project/ios && npm install && xcodebuild -workspace BlePlxExample.xcworkspace -scheme BlePlxExample -configuration Debug -sdk iphonesimulator ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO", - "test:expo": "cd test_project && npx expo prebuild", + "test:ios": "cd example/ios && npm install && xcodebuild -workspace BlePlxExample.xcworkspace -scheme BlePlxExample -configuration Debug -sdk iphonesimulator ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO", + "test:expo": "cd example && npx expo prebuild", "bootstrap": "yarn example && yarn install && yarn example pods", "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build plugin/build lib", "build:plugin": "tsc --build plugin", diff --git a/scripts/copyExampleProjectFiles.js b/scripts/copyExampleProjectFiles.js index 5ceee843..2297f14d 100644 --- a/scripts/copyExampleProjectFiles.js +++ b/scripts/copyExampleProjectFiles.js @@ -20,7 +20,6 @@ const jsSourceDestinationDirectory = path.join(__dirname, TEST_PROJECT_DIR_NAME, const copyExampleProjectJsFiles = () => { console.info('Copying src from example to test_project') fs.cpSync(jsSourceDirectory, jsSourceDestinationDirectory, { recursive: true }) - fs.readFile('test_project/yarn.lock', (err, data) => {}) } const androidManifestDestinationPath = path.join(