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

Build monorepo CI #3747

Merged
merged 36 commits into from
Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b25f73c
Setup monorepo action
piaskowyk Nov 7, 2022
ffc6cff
Build monorepo CI
piaskowyk Nov 7, 2022
7e8dcf7
Update path
piaskowyk Nov 7, 2022
3229973
Add job's name
piaskowyk Nov 7, 2022
4dbfd31
Add runner
piaskowyk Nov 7, 2022
ff16aa4
Build monorepo
piaskowyk Nov 7, 2022
3f43cc4
Update names
piaskowyk Nov 7, 2022
0dab8b2
Fix syntax
piaskowyk Nov 7, 2022
f87a429
Test v1
piaskowyk Nov 7, 2022
77e7e20
Test v2
piaskowyk Nov 7, 2022
af6e821
Test v3
piaskowyk Nov 7, 2022
a34652d
Test v4
piaskowyk Nov 7, 2022
2448648
Test v5
piaskowyk Nov 7, 2022
d1d2a6c
Test v6
piaskowyk Nov 7, 2022
775d68a
Test v7
piaskowyk Nov 7, 2022
daae485
Test v8
piaskowyk Nov 7, 2022
f79ecfe
Test v9
piaskowyk Nov 7, 2022
09d3de7
Test v10
piaskowyk Nov 7, 2022
84c1a30
Test v11
piaskowyk Nov 7, 2022
1adec5c
Test v12
piaskowyk Nov 7, 2022
b86b1ce
Test v13
piaskowyk Nov 7, 2022
65d11e5
Test v14
piaskowyk Nov 7, 2022
20c75ac
Update names
piaskowyk Nov 7, 2022
7bcad1d
Test syntax
piaskowyk Nov 8, 2022
ad53a5c
Test syntax v2
piaskowyk Nov 8, 2022
12bcfbd
Update args
piaskowyk Nov 8, 2022
dc0b3fc
Test syntax
piaskowyk Nov 8, 2022
471a28e
Test syntax
piaskowyk Nov 8, 2022
59530a8
Test syntax
piaskowyk Nov 8, 2022
bd6fb6d
Test rn version
piaskowyk Nov 8, 2022
da3c758
RN version for both
piaskowyk Nov 8, 2022
9d5130b
Add catalog
piaskowyk Nov 8, 2022
fe0c661
Cleanup
piaskowyk Nov 8, 2022
198cf31
Remove subcatalog
piaskowyk Nov 8, 2022
44c15a9
Update names
piaskowyk Nov 8, 2022
a7fe56f
Update names v2
piaskowyk Nov 8, 2022
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
47 changes: 47 additions & 0 deletions .github/workflows/build-monorepo-runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Test build in monorepo
on:
pull_request:
paths:
- .github/workflows/build-monorepo.yml
piaskowyk marked this conversation as resolved.
Show resolved Hide resolved
- RNReanimated.podspec
- android/build.gradle
push:
branches:
- main

jobs:
build_android_reanimated_in_app:
name: Build Android with in app Reanimated
piaskowyk marked this conversation as resolved.
Show resolved Hide resolved
uses: ./.github/workflows/build-monorepo.yml
piaskowyk marked this conversation as resolved.
Show resolved Hide resolved
with:
runs_on: ubuntu-latest
os: Android
concurrency_group: build_monorepo_android_in_app_reanimated
piaskowyk marked this conversation as resolved.
Show resolved Hide resolved
is_hoisted: false

build_ios_reanimated_in_app:
name: Build iOS with in app Reanimated
uses: ./.github/workflows/build-monorepo.yml
with:
runs_on: macos-12
os: iOS
concurrency_group: build_monorepo_ios_in_app_reanimated
is_hoisted: false

build_android_reanimated_hoisted:
name: Build Android with hoisted Reanimated
uses: ./.github/workflows/build-monorepo.yml
with:
runs_on: ubuntu-latest
os: Android
concurrency_group: build_monorepo_android_reanimated_hoisted
is_hoisted: true

build_ios_reanimated_hoisted:
name: Build iOS with hoisted Reanimated
uses: ./.github/workflows/build-monorepo.yml
with:
runs_on: macos-12
os: iOS
concurrency_group: build_monorepo_ios_reanimated_hoisted
is_hoisted: true
76 changes: 76 additions & 0 deletions .github/workflows/build-monorepo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Test build in monorepo
on:
workflow_call:
inputs:
runs_on:
required: true
type: string
os:
piaskowyk marked this conversation as resolved.
Show resolved Hide resolved
required: true
type: string
concurrency_group:
required: true
type: string
is_hoisted:
required: true
type: boolean

jobs:
build:
name: Build monorepo with Reanimated
runs-on: ${{ inputs.runs_on }}
piaskowyk marked this conversation as resolved.
Show resolved Hide resolved
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
tomekzaw marked this conversation as resolved.
Show resolved Hide resolved
working-directory: monorepo
run: npx react-native@next init RootApp
piaskowyk marked this conversation as resolved.
Show resolved Hide resolved
- name: Create PackageApp
working-directory: monorepo/packages
run: npx react-native@next init PackageApp

- name: Install dependencies for RootApp
working-directory: monorepo/RootApp
run: yarn add github:software-mansion/react-native-reanimated#${{ github.ref }}
tomekzaw marked this conversation as resolved.
Show resolved Hide resolved
- 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 }}
run: yarn add github:software-mansion/react-native-reanimated#${{ github.ref }} -W

- name: Install Pods for RootApp
if: ${{ inputs.os == 'iOS' }}
working-directory: monorepo/RootApp/ios
run: pod install
- name: Install Pods for PackageApp
if: ${{ inputs.os == 'iOS' }}
working-directory: monorepo/packages/PackageApp/ios
run: pod install

- name: Build iOS app RootApp
if: ${{ inputs.os == 'iOS' }}
working-directory: monorepo/RootApp
run: npx react-native run-ios
piaskowyk marked this conversation as resolved.
Show resolved Hide resolved
- name: Build iOS app PackageApp
if: ${{ inputs.os == 'iOS' }}
working-directory: monorepo/packages/PackageApp
run: npx react-native run-ios

- name: Build Android RootApp
if: ${{ inputs.os == 'Android' }}
working-directory: monorepo/RootApp/android
run: ./gradlew assembleDebug --console=plain
- name: Build Android PackageApp
if: ${{ inputs.os == 'Android' }}
working-directory: monorepo/packages/PackageApp/android
run: ./gradlew assembleDebug --console=plain