-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Description CI for testing monorepo build.
- Loading branch information
Showing
6 changed files
with
127 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Test build in monorepo | ||
on: | ||
workflow_call: | ||
inputs: | ||
platform: | ||
required: true | ||
type: string | ||
concurrency_group: | ||
required: true | ||
type: string | ||
is_hoisted: | ||
required: true | ||
type: boolean | ||
react_native_version: | ||
required: false | ||
type: string | ||
|
||
env: | ||
REACT_NATIVE_TEMPLATE: ${{ inputs.react_native_version && '--version' || '' }} ${{ inputs.react_native_version }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ inputs.platform == 'iOS' && 'macos-12' || 'ubuntu-latest' }} | ||
concurrency: | ||
group: ${{ inputs.concurrency_group }} | ||
cancel-in-progress: true | ||
steps: | ||
- name: Create monorepo | ||
run: | | ||
mkdir monorepo | ||
cd monorepo | ||
echo '{"name":"rnos-monorepo-tester","version":"1.0.0","license":"MIT","private":true,"workspaces":{"packages":["RootApp","packages/PackageApp", "AppA", "AppB"],"nohoist":["**/react","**/react-dom","**/react-native","**/react-native/**","**/react-native-codegen","**/react-native-dev-menu"]}}' > package.json | ||
yarn | ||
mkdir packages | ||
- name: Create RootApp | ||
working-directory: monorepo | ||
run: npx react-native@next init RootApp ${{ env.REACT_NATIVE_TEMPLATE }} | ||
- name: Create PackageApp | ||
working-directory: monorepo/packages | ||
run: npx react-native@next init PackageApp ${{ env.REACT_NATIVE_TEMPLATE }} | ||
|
||
- name: Install dependencies for RootApp | ||
working-directory: monorepo/RootApp | ||
run: yarn add github:software-mansion/react-native-reanimated#${{ github.ref }} | ||
- name: Install dependencies for PackageApp | ||
working-directory: monorepo/packages/PackageApp | ||
run: yarn add github:software-mansion/react-native-reanimated#${{ github.ref }} | ||
|
||
- name: Setup hoisted Reanimated | ||
if: ${{ inputs.is_hoisted }} | ||
working-directory: monorepo | ||
run: yarn add github:software-mansion/react-native-reanimated#${{ github.ref }} -W | ||
|
||
- name: Install Pods for RootApp | ||
if: ${{ inputs.platform == 'iOS' }} | ||
working-directory: monorepo/RootApp/ios | ||
run: pod install | ||
- name: Install Pods for PackageApp | ||
if: ${{ inputs.platform == 'iOS' }} | ||
working-directory: monorepo/packages/PackageApp/ios | ||
run: pod install | ||
|
||
- name: Build iOS app RootApp | ||
if: ${{ inputs.platform == 'iOS' }} | ||
working-directory: monorepo/RootApp | ||
run: yarn react-native run-ios | ||
- name: Build iOS app PackageApp | ||
if: ${{ inputs.platform == 'iOS' }} | ||
working-directory: monorepo/packages/PackageApp | ||
run: yarn react-native run-ios | ||
|
||
- name: Build Android RootApp | ||
if: ${{ inputs.platform == 'Android' }} | ||
working-directory: monorepo/RootApp/android | ||
run: ./gradlew assembleDebug --console=plain | ||
- name: Build Android PackageApp | ||
if: ${{ inputs.platform == 'Android' }} | ||
working-directory: monorepo/packages/PackageApp/android | ||
run: ./gradlew assembleDebug --console=plain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Test monorepo build | ||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/build-monorepo.yml | ||
- .github/workflows/build-monorepo-action.yml | ||
- RNReanimated.podspec | ||
- android/build.gradle | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build_android_reanimated_non_hoisted: | ||
name: Android (non-hoisted Reanimated) | ||
uses: ./.github/workflows/build-monorepo-action.yml | ||
with: | ||
platform: Android | ||
concurrency_group: build_monorepo_android_in_app_reanimated-${{ github.ref }} | ||
is_hoisted: false | ||
|
||
build_ios_reanimated_non_hoisted: | ||
name: iOS (non-hoisted Reanimated) | ||
uses: ./.github/workflows/build-monorepo-action.yml | ||
with: | ||
platform: iOS | ||
concurrency_group: build_monorepo_ios_in_app_reanimated-${{ github.ref }} | ||
is_hoisted: false | ||
|
||
build_android_reanimated_hoisted: | ||
name: Android (hoisted Reanimated) | ||
uses: ./.github/workflows/build-monorepo-action.yml | ||
with: | ||
platform: Android | ||
concurrency_group: build_monorepo_android_reanimated_hoisted-${{ github.ref }} | ||
is_hoisted: true | ||
|
||
build_ios_reanimated_hoisted: | ||
name: iOS (hoisted Reanimated) | ||
uses: ./.github/workflows/build-monorepo-action.yml | ||
with: | ||
platform: iOS | ||
concurrency_group: build_monorepo_ios_reanimated_hoisted-${{ github.ref }} | ||
is_hoisted: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters