Skip to content

Commit

Permalink
fix: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
intent-kacper-cyranowski committed Jun 20, 2024
1 parent 8433fd9 commit 52ff471
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 32 deletions.
32 changes: 16 additions & 16 deletions .github/actions/setup_test_project/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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-
Expand Down Expand Up @@ -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 }}"
Expand Down Expand Up @@ -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
Expand All @@ -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-
Expand Down
10 changes: 9 additions & 1 deletion example/app.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"name": "BlePlxExample",
"displayName": "BlePlxExample"
"displayName": "BlePlxExample",
"expo": {
"android": {
"package": "com.testProject"
},
"ios": {
"bundleIdentifier": "com.testProject"
}
}
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 && 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",
Expand Down
1 change: 0 additions & 1 deletion scripts/copyExampleProjectFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 52ff471

Please sign in to comment.