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

Monorepo [0/?] - move move github actions to root #5993

Merged
merged 40 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
409fdc5
move github actions to root
tjzel May 8, 2024
079dc5b
fix android-build, validate-plugin, validate-yarn
tjzel May 8, 2024
d9f70d8
move annotation script and fix validators
tjzel May 8, 2024
4ee2a88
remove husky install step
tjzel May 8, 2024
19b2146
fix some validations and handle static checks
tjzel May 8, 2024
9487686
fix path for annotations
tjzel May 8, 2024
6cbe745
fix detect-borken-ulrs and check-ts-react-native
tjzel May 8, 2024
5260887
remove hardened mode flag for monorepo build
tjzel May 8, 2024
06ecd2d
fix docs-check and check-static-framework-nightly
tjzel May 8, 2024
70c56cd
fix build-next-example
tjzel May 8, 2024
bf0177c
fix more
tjzel May 8, 2024
62b8c3e
fix more
tjzel May 8, 2024
3d78462
more fixes
tjzel May 8, 2024
1e01e42
trying to fix some yarn.lock issues
tjzel May 8, 2024
e3d4b0d
lets see
tjzel May 8, 2024
6a32c82
disable hardened mode for v8
tjzel May 8, 2024
48c9d0c
v8 and monorepo are naughty
tjzel May 8, 2024
0a7576a
one more
tjzel May 8, 2024
818291e
testing
tjzel May 8, 2024
dfbf55b
testing v2
tjzel May 8, 2024
830c680
not sure what fails
tjzel May 8, 2024
cdaf155
yarn.lock ikd
tjzel May 8, 2024
7edb9f2
more debugging
tjzel May 8, 2024
f7dedbe
its starting to be painful
tjzel May 8, 2024
9f39505
corepack help
tjzel May 8, 2024
4bd7e9e
even more debugging
tjzel May 8, 2024
975099b
cleanup
tjzel May 9, 2024
2ff1898
mergele upstream
tjzel May 9, 2024
d56d000
mergele main
tjzel May 17, 2024
2b53648
Merge branch '@tjzel/monorepo' into @tjzel/monorepo-github-actions
tjzel May 17, 2024
bfeba89
Merge branch '@tjzel/monorepo' into @tjzel/monorepo-github-actions
tjzel May 17, 2024
e6b2ddd
fix plugin lint
tjzel May 17, 2024
a609884
mergele upstream
tjzel May 17, 2024
692e079
add version for monorepo
tjzel May 17, 2024
d0e88a8
touch more CIs
tjzel May 20, 2024
6cabace
huh
tjzel May 20, 2024
a173b6d
npm package
tjzel May 20, 2024
4a4cd1b
remove rea2
tjzel May 20, 2024
4b7f8eb
Merge branch '@tjzel/monorepo' into @tjzel/monorepo-github-actions
tjzel May 29, 2024
c8a4cab
fix
tjzel May 29, 2024
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
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
pull_request:
paths:
- .github/workflows/android-build.yml
- android/**
- Common/**
- Example/package.json
- Example/android/**
- FabricExample/package.json
- FabricExample/android/**
- packages/react-native-reanimated/android/**
- packages/react-native-reanimated/Common/**
- packages/react-native-reanimated/Example/package.json
- packages/react-native-reanimated/Example/android/**
- packages/react-native-reanimated/FabricExample/package.json
- packages/react-native-reanimated/FabricExample/android/**
merge_group:
branches:
- main
Expand All @@ -19,20 +19,24 @@ on:
- main
paths:
- .github/workflows/android-build.yml
- android/**
- Common/**
- Example/package.json
- Example/android/**
- FabricExample/package.json
- FabricExample/android/**
- packages/react-native-reanimated/android/**
- packages/react-native-reanimated/Common/**
- packages/react-native-reanimated/Example/package.json
- packages/react-native-reanimated/Example/android/**
- packages/react-native-reanimated/FabricExample/package.json
- packages/react-native-reanimated/FabricExample/android/**

jobs:
build:
if: github.repository == 'software-mansion/react-native-reanimated'
runs-on: ubuntu-latest
strategy:
matrix:
working-directory: [Example, FabricExample]
working-directory:
[
packages/react-native-reanimated/Example,
packages/react-native-reanimated/FabricExample,
]
fail-fast: false
concurrency:
group: android-${{ matrix.working-directory }}-${{ github.ref }}
Expand All @@ -41,20 +45,24 @@ jobs:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Install dependencies in root
run: yarn install --immutable

- name: Setup Java 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
distribution: "zulu"
java-version: 17

- name: Restore Reanimated node_modules from cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-android-node-modules-reanimated-${{ hashFiles('yarn.lock') }}
path: packages/react-native-reanimated/node_modules
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @tomekzaw

If you could explain to me (preferably offline) how does the memoization work here.

key: ${{ runner.os }}-android-node-modules-reanimated-${{ hashFiles('packages/react-native-reanimated/yarn.lock') }}
restore-keys: ${{ runner.os }}-android-node-modules-reanimated-

- name: Install Reanimated node_modules
working-directory: packages/react-native-reanimated
run: yarn install --immutable

- name: Restore app node_modules from cache
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
name: Test monorepo build
env:
YARN_ENABLE_HARDENED_MODE: 0
on:
pull_request:
paths:
- .github/workflows/build-monorepo.yml
- .github/workflows/build-monorepo-action.yml
- RNReanimated.podspec
- scripts/reanimated_utils.rb
- android/build.gradle
- packages/react-native-reanimated/scripts/reanimated_utils.rb
- packages/react-native-reanimated/android/build.gradle
merge_group:
branches:
- main
Expand All @@ -18,9 +16,9 @@ on:
paths:
- .github/workflows/build-monorepo.yml
- .github/workflows/build-monorepo-action.yml
- RNReanimated.podspec
- scripts/reanimated_utils.rb
- android/build.gradle
- packages/react-native-reanimated/RNReanimated.podspec
- packages/react-native-reanimated/scripts/reanimated_utils.rb
- packages/react-native-reanimated/android/build.gradle
workflow_call:

jobs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ on:
pull_request:
paths:
- .github/workflows/build-next-example.yml
- 'src/**'
- 'NextExample/**'
- "packages/react-native-reanimated/src/**"
- "packages/react-native-reanimated/NextExample/**"
push:
branches:
- master
- main

jobs:
check:
Expand All @@ -20,21 +20,23 @@ jobs:
steps:
- name: Checkout Git repository
uses: actions/checkout@v4

- name: Install Reanimated node_modules
- name: Install monorepo node dependencies
run: yarn install --immutable

- name: Build package
- name: Install Reanimated node dependencies
working-directory: packages/react-native-reanimated
run: yarn install --immutable
- name: Build Reanimated package
working-directory: packages/react-native-reanimated
run: yarn build

- name: Install NextExample node_modules
working-directory: NextExample
working-directory: packages/react-native-reanimated/NextExample
run: yarn install --immutable

- name: Compile production build
working-directory: NextExample
working-directory: packages/react-native-reanimated/NextExample
run: yarn build

- name: Run e2e tests
working-directory: NextExample
working-directory: packages/react-native-reanimated/NextExample
run: yarn e2e:headless
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,20 @@ on:
ref:
required: false
type: string
upload_binaries:
required: false
type: boolean
publish_on_npm:
required: false
type: boolean
secrets:
NODE_AUTH_TOKEN:
required: false
workflow_dispatch:
inputs:
option:
required: false
type: string
ref:
required: false
type: string

jobs:
build:
Expand All @@ -36,72 +41,41 @@ jobs:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Clear annotations
run: scripts/clear-annotations.sh

- name: Set up JDK 11
if: ${{ inputs.ref == 'Reanimated2' }}
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'

- name: Install NDK
if: ${{ inputs.ref == 'Reanimated2' }}
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r21d
run: .github/workflows/helper/clear-annotations.sh

- name: Build package
working-directory: packages/react-native-reanimated
id: build
env:
ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
run: >-
./createNPMPackage.sh ${{ inputs.option }} 2> build.log
./createNPMPackage.sh ${{ inputs.option }}

- name: Check if any node_modules were packed
working-directory: packages/react-native-reanimated
id: node_modules
run: >-
! grep --silent -E "node_modules/.+"

- name: Check if size is over 1MB
if: ${{ inputs.ref != 'Reanimated2' }}
id: size
run: grep --silent -E "npm notice package size:\s*[0-9][0-9]?[0-9]?(\.[0-9]*)?\s*kB" build.log
! grep --silent -E "node_modules/.+" build.log

- name: Show build log
working-directory: packages/react-native-reanimated
if: failure() && steps.build.outcome == 'failure'
run: >-
cat build.log

- name: Show packed node_modules
working-directory: packages/react-native-reanimated
if: failure() && steps.node_modules.outcome == 'failure'
run: >-
! grep -E "node_modules/.+"
! grep -E "node_modules/.+" build.log

- name: Show exceeded package size
if: failure() && steps.size.outcome == 'failure'
run: grep -E "npm notice package size:" build.log

- run: echo "PACKAGE_NAME=$(ls -l | egrep -o "react-native-reanimated-(.*)(=?\.tgz)")" >> $GITHUB_ENV
- name: Add package name to env
working-directory: packages/react-native-reanimated
run: echo "PACKAGE_NAME=$(ls -l | egrep -o "react-native-reanimated-(.*)(=?\.tgz)")" >> $GITHUB_ENV

- name: Upload npm package
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }}
path: '*.tgz'

- name: Compress Android build output
if: ${{ inputs.upload_binaries }}
run: zip -r android-build-output.zip build_output

- name: Upload Android build folder
if: ${{ inputs.upload_binaries }}
uses: actions/upload-artifact@v4
with:
name: android-build-output
path: android-build-output.zip
retention-days: 5
path: "packages/react-native-reanimated/${{ env.PACKAGE_NAME }}"

- run: npm publish $PACKAGE_NAME --tag nightly
if: ${{ inputs.publish_on_npm }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
paths:
- .github/workflows/check-TS-react-native.yml
schedule:
- cron: '37 19 * * *'
- cron: "37 19 * * *"
workflow_dispatch:

jobs:
Expand All @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
react-native-version: ['0.71', '0.72', '0.73', '0.74.0-rc.6', nightly]
react-native-version: ["0.71", "0.72", "0.73", "0.74", nightly]
fail-fast: false
concurrency:
group: TS-react-native-nightly-${{ matrix.react-native-version }}-${{ github.ref }}
Expand All @@ -26,23 +26,35 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: 'yarn'
cache: "yarn"
- name: Clear annotations
run: scripts/clear-annotations.sh
- name: Install dependencies
run: .github/workflows/helper/clear-annotations.sh

- name: Install monorepo node dependencies
run: yarn install
- name: Install Reanimated node dependencies
working-directory: packages/react-native-reanimated
run: yarn install
- name: Build repo
- name: Build Reanimated node dependencies
working-directory: packages/react-native-reanimated
run: yarn build
- name: Install react-native ${{ matrix.react-native-version }}
working-directory: packages/react-native-reanimated
run: yarn add --dev react-native@${{ matrix.react-native-version }}

- name: Check source types
working-directory: packages/react-native-reanimated
run: yarn type:check:src
- name: Check plugin types
working-directory: packages/react-native-reanimated
run: yarn type:check:plugin
- name: Check API
working-directory: packages/react-native-reanimated
run: yarn type:check:app
- name: Run common type tests
working-directory: packages/react-native-reanimated
run: yarn type:check:tests:common
- name: Run 0.72+ type tests
working-directory: packages/react-native-reanimated
if: matrix.react-native-version != '0.71'
run: yarn type:check:tests:0.72+
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: Check React Native nightly build
env:
YARN_ENABLE_HARDENED_MODE: 0
on:
pull_request:
paths:
- .github/workflows/check-react-native-nightly.yml
schedule:
- cron: '37 19 * * *'
- cron: "37 19 * * *"
workflow_dispatch:

jobs:
Expand All @@ -15,17 +13,20 @@ jobs:
runs-on: macos-14
strategy:
matrix:
react-native-architecture: ['Paper', 'Fabric']
react-native-architecture: ["Paper", "Fabric"]
fail-fast: false
concurrency:
group: ios-react-native-nightly-${{ matrix.react-native-architecture }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Create app
run: npx react-native init app --skip-install --version nightly
- name: Download Reanimated from commit
working-directory: app
run: curl -LJO https://codeload.github.com/software-mansion/react-native-reanimated/tar.gz/${{ github.sha }}
- name: Install Reanimated
working-directory: app
run: yarn add github:software-mansion/react-native-reanimated
run: yarn add react-native-reanimated@file:./react-native-reanimated-${{ github.sha }}.tar.gz
- name: Install Paper Pods
if: ${{ matrix.react-native-architecture == 'Paper' }}
working-directory: app/ios
Expand All @@ -43,7 +44,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
react-native-architecture: ['Paper', 'Fabric']
react-native-architecture: ["Paper", "Fabric"]
fail-fast: false
concurrency:
group: android-react-native-nightly-${{ matrix.react-native-architecture }}-${{ github.ref }}
Expand All @@ -52,13 +53,16 @@ jobs:
- name: Set up JDK 18
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '18'
distribution: "zulu"
java-version: "18"
- name: Create app
run: npx react-native init app --skip-install --version nightly
- name: Download Reanimated from commit
working-directory: app
run: curl -LJO https://codeload.github.com/software-mansion/react-native-reanimated/tar.gz/${{ github.sha }}
- name: Install Reanimated
working-directory: app
run: yarn add github:software-mansion/react-native-reanimated
run: yarn add react-native-reanimated@file:./react-native-reanimated-${{ github.sha }}.tar.gz
- name: Setup Fabric
if: ${{ matrix.react-native-architecture == 'Fabric' }}
working-directory: app/android
Expand Down
Loading
Loading