Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add node version variable #1114

Merged
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
7 changes: 5 additions & 2 deletions .github/actions/setup_test_project/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ inputs:
REACT_NATIVE_VERSION:
description: React Native version to use
required: false
NODE_VERSION:
description: Node version to use # https://github.com/actions/setup-node#supported-version-syntax
required: false

runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
node-version: ${{ inputs.NODE_VERSION }}

- name: Initialize project template
run: npx react-native@latest init BlePlxExample --version ${{ inputs.REACT_NATIVE_VERSION }} --directory test_project --skip-install --verbose
Expand All @@ -27,7 +30,7 @@ runs:
restore-keys: |
${{ 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
Expand Down
38 changes: 25 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,16 @@ jobs:
run: yarn prepack

build-android:
runs-on: ubuntu-latest
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
react_native_version: ['0.72.4', ' 0.71.13', '0.70.13']
configurations:
[
{ 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 }
]
env:
TURBO_CACHE_DIR: .turbo/android
steps:
Expand All @@ -62,15 +67,16 @@ jobs:
- name: Setup
uses: ./.github/actions/setup_test_project
with:
REACT_NATIVE_VERSION: ${{ matrix.react_native_version }}
REACT_NATIVE_VERSION: ${{ matrix.configurations.react_native_version }}
NODE_VERSION: ${{ matrix.configurations.node_version }}

- name: Cache turborepo for Android
uses: actions/cache@v3
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-${{ matrix.react_native_version }}-turborepo-android-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-${{ matrix.configurations.react_native_version }}-turborepo-android-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.react_native_version }}-turborepo-android-
${{ runner.os }}-${{ matrix.configurations.react_native_version }}-turborepo-android-

- name: Check turborepo cache for Android
run: |
Expand Down Expand Up @@ -99,9 +105,9 @@ jobs:
path: |
~/.gradle/wrapper
~/.gradle/caches
key: ${{ runner.os }}-${{ matrix.react_native_version }}-gradle-${{ hashFiles('test_project/android/gradle/wrapper/gradle-wrapper.properties') }}
key: ${{ runner.os }}-${{ matrix.configurations.react_native_version }}-gradle-${{ hashFiles('test_project/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-${{ matrix.react_native_version }}-gradle-
${{ runner.os }}-${{ matrix.configurations.react_native_version }}-gradle-

- name: Build example for Android
run: |
Expand All @@ -112,7 +118,12 @@ jobs:
strategy:
fail-fast: false
matrix:
react_native_version: ['0.72.4', ' 0.71.13', '0.70.13']
configurations:
[
{ 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 }
]
env:
TURBO_CACHE_DIR: .turbo/ios
steps:
Expand All @@ -122,15 +133,16 @@ jobs:
- name: Setup
uses: ./.github/actions/setup_test_project
with:
REACT_NATIVE_VERSION: ${{ matrix.react_native_version }}
REACT_NATIVE_VERSION: ${{ matrix.configurations.react_native_version }}
NODE_VERSION: ${{ matrix.configurations.node_version }}

- name: Cache turborepo for iOS
uses: actions/cache@v3
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-${{ matrix.react_native_version }}-turborepo-ios-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-${{ matrix.configurations.react_native_version }}-turborepo-ios-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.react_native_version }}-turborepo-ios-
${{ runner.os }}-${{ matrix.configurations.react_native_version }}-turborepo-ios-

- name: Check turborepo cache for iOS
run: |
Expand All @@ -147,9 +159,9 @@ jobs:
with:
path: |
**/ios/Pods
key: ${{ runner.os }}-${{ matrix.react_native_version }}-cocoapods-${{ hashFiles('test_project/ios/Podfile.lock') }}
key: ${{ runner.os }}-${{ matrix.configurations.react_native_version }}-cocoapods-${{ hashFiles('test_project/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.react_native_version }}-cocoapods-
${{ runner.os }}-${{ matrix.configurations.react_native_version }}-cocoapods-

- name: Install cocoapods
if: env.turbo_cache_hit != 1
Expand Down