Skip to content

Commit

Permalink
chore: add expo to test matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
dimninik committed Nov 8, 2023
1 parent baf25a9 commit cd5656e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
12 changes: 11 additions & 1 deletion .github/actions/setup_test_project/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ inputs:
NODE_VERSION:
description: Node version to use # https://github.com/actions/setup-node#supported-version-syntax
required: false
IS_EXPO:
description: Should template use expo
required: false
default: false

runs:
using: composite
Expand All @@ -16,10 +20,16 @@ runs:
with:
node-version: ${{ inputs.NODE_VERSION }}

- name: Initialize project template
- name: Initialize project default template
if: '${{ inputs.IS_EXPO == false }}'
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 BlePlxExample --directory test_project --skip-install --verbose
shell: bash

- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v3
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ jobs:
[
{ react_native_version: '0.72.6', node_version: 18 },
{ react_native_version: '0.71.14', node_version: 16 },
{ react_native_version: '0.70.13', node_version: 16 }
{ react_native_version: '0.70.13', node_version: 16 },
{ react_native_version: 'expo', node_version: 18, is_expo: true }
]
env:
TURBO_CACHE_DIR: .turbo/android
Expand All @@ -69,6 +70,7 @@ jobs:
with:
REACT_NATIVE_VERSION: ${{ matrix.configurations.react_native_version }}
NODE_VERSION: ${{ matrix.configurations.node_version }}
IS_EXPO: ${{ matrix.configurations.is_expo }}

- name: Cache turborepo for Android
uses: actions/cache@v3
Expand Down Expand Up @@ -110,9 +112,15 @@ jobs:
${{ runner.os }}-${{ matrix.configurations.react_native_version }}-gradle-
- name: Build example for Android
if: '${{ matrix.configurations.is_expo == false }}'
run: |
yarn turbo run test:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
- name: Build example for expo Android
if: '${{ matrix.configurations.is_expo == true }}'
run: |
yarn turbo run test:androidExpo --cache-dir="${{ env.TURBO_CACHE_DIR }}"
build-ios:
runs-on: macos-latest
strategy:
Expand All @@ -122,7 +130,8 @@ jobs:
[
{ react_native_version: '0.72.6', node_version: 18 },
{ react_native_version: '0.71.14', node_version: 16 },
{ react_native_version: '0.70.13', node_version: 16 }
{ react_native_version: '0.70.13', node_version: 16 },
{ react_native_version: 'expo', node_version: 18, is_expo: true }
]
env:
TURBO_CACHE_DIR: .turbo/ios
Expand All @@ -135,6 +144,7 @@ jobs:
with:
REACT_NATIVE_VERSION: ${{ matrix.configurations.react_native_version }}
NODE_VERSION: ${{ matrix.configurations.node_version }}
IS_EXPO: ${{ matrix.configurations.is_expo }}

- name: Cache turborepo for iOS
uses: actions/cache@v3
Expand Down Expand Up @@ -172,5 +182,10 @@ jobs:
NO_FLIPPER: 1

- name: Build test_project for iOS
if: env.turbo_cache_hit != 1 && '${{ matrix.configurations.is_expo == false }}'
run: |
yarn turbo run test:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
- name: Build test_project for expo iOS
if: env.turbo_cache_hit != 1 && '${{ matrix.configurations.is_expo == true }}'
run: yarn turbo run test:iosExpo --cache-dir="${{ env.TURBO_CACHE_DIR }}"
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@
"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:androidExpo": "cd test_project && npx expo run:android",
"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 && xcodebuild -workspace BlePlxExample.xcworkspace -scheme BlePlxExample -configuration Debug -sdk iphonesimulator ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO",
"test:iosExpo": "cd test_project && npx expo run:ios",
"bootstrap": "yarn example && yarn install && yarn example pods",
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build",
"build:plugin": "tsc --build plugin",
Expand Down

0 comments on commit cd5656e

Please sign in to comment.