From 250e39b7481601ceb58922ae38c17ce18f893e75 Mon Sep 17 00:00:00 2001 From: Alex Cynk Date: Tue, 13 Aug 2024 17:07:02 +0200 Subject: [PATCH] Fix github workflows (#6412) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary 1. **Fix paths** - Workflow files have been renamed, but the paths inside the workflows weren't updated - Due to this mismatch the workflow is not triggered once it is edited 4. **Fix caching** - Remove caching when building apps (it wasn't working well) ## Test plan There are failing tests, but their fail in not depending on this PR ![image](https://github.com/user-attachments/assets/e30cef02-9175-4ca4-9442-4ab2115e0a98) ![image](https://github.com/user-attachments/assets/55730ecd-e691-49be-be80-194fd7ba5706) --------- Co-authored-by: Tomasz Żelawski <40713406+tjzel@users.noreply.github.com> --- .../workflows/babel-plugin-static-check.yml | 4 +- .../workflows/docs-reanimated-build-check.yml | 2 +- .github/workflows/docs-reanimated-publish.yml | 3 +- .../workflows/example-android-build-check.yml | 18 ++------- .github/workflows/example-ios-build-check.yml | 34 ++--------------- .../workflows/example-macos-build-check.yml | 7 ++-- .../example-next-build-check-and-test.yml | 2 +- .../workflows/example-tvos-build-check.yml | 38 ++----------------- .../expo-devclient-build-check-nightly.yml | 2 +- ...epo-app-reanimated-build-check-nightly.yml | 8 ++-- ...nightly-reanimated-build-check-nightly.yml | 2 +- .../reanimated-android-validation.yml | 4 +- .../workflows/reanimated-apple-validation.yml | 4 +- .../reanimated-common-validation.yml | 4 +- ...-typescript-compatibility-test-nightly.yml | 2 +- ...amework-reanimated-build-check-nightly.yml | 2 +- .github/workflows/url-validation-nightly.yml | 2 +- ...ted-app-reanimated-build-check-nightly.yml | 2 +- .github/workflows/yarn-validation.yml | 4 +- 19 files changed, 37 insertions(+), 107 deletions(-) diff --git a/.github/workflows/babel-plugin-static-check.yml b/.github/workflows/babel-plugin-static-check.yml index dae3cb458d7..c92d8c7c258 100644 --- a/.github/workflows/babel-plugin-static-check.yml +++ b/.github/workflows/babel-plugin-static-check.yml @@ -4,7 +4,7 @@ env: on: pull_request: paths: - - '.github/workflows/validate-plugin.yml' + - '.github/workflows/babel-plugin-static-check.yml' - 'packages/react-native-reanimated/plugin/**' merge_group: branches: @@ -13,7 +13,7 @@ on: branches: - main paths: - - '.github/workflows/validate-plugin.yml' + - '.github/workflows/babel-plugin-static-check.yml' - 'packages/react-native-reanimated/plugin/**' jobs: diff --git a/.github/workflows/docs-reanimated-build-check.yml b/.github/workflows/docs-reanimated-build-check.yml index 4b058398d39..45337f91edf 100644 --- a/.github/workflows/docs-reanimated-build-check.yml +++ b/.github/workflows/docs-reanimated-build-check.yml @@ -4,7 +4,7 @@ env: on: pull_request: paths: - - '.github/workflows/docs-check.yml' + - '.github/workflows/docs-reanimated-build-check.yml' - packages/docs-reanimated/** merge_group: branches: diff --git a/.github/workflows/docs-reanimated-publish.yml b/.github/workflows/docs-reanimated-publish.yml index b1b2dd51908..8c76c440ea4 100644 --- a/.github/workflows/docs-reanimated-publish.yml +++ b/.github/workflows/docs-reanimated-publish.yml @@ -5,7 +5,8 @@ on: push: branches: - main - paths: packages/docs-reanimated/** + paths: + - packages/docs-reanimated/** workflow_dispatch: jobs: diff --git a/.github/workflows/example-android-build-check.yml b/.github/workflows/example-android-build-check.yml index 65d0454ce8d..598d27bce8a 100644 --- a/.github/workflows/example-android-build-check.yml +++ b/.github/workflows/example-android-build-check.yml @@ -4,7 +4,7 @@ env: on: pull_request: paths: - - .github/workflows/android-build.yml + - .github/workflows/example-android-build-check.yml - packages/react-native-reanimated/android/** - packages/react-native-reanimated/Common/** - apps/paper-example/package.json @@ -18,7 +18,7 @@ on: branches: - main paths: - - .github/workflows/android-build.yml + - .github/workflows/example-android-build-check.yml - packages/react-native-reanimated/android/** - packages/react-native-reanimated/Common/** - apps/paper-example/package.json @@ -47,19 +47,7 @@ jobs: distribution: 'zulu' java-version: 17 - # TODO: Rework caching in this CI for monorepo setup. - - name: Restore node_modules from cache - uses: actions/cache@v3 - with: - path: . - key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }} - restore-keys: ${{ runner.os }}-node-modules- - - name: Restore app node_modules from cache - uses: actions/cache@v3 - with: - path: ${{ matrix.working-directory }}/node_modules - key: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/yarn.lock', matrix.working-directory)) }} - restore-keys: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}- + # TODO: Add caching for node_modules and artifacts that will work with monorepo setup. - name: Install monorepo node dependencies run: yarn install --immutable diff --git a/.github/workflows/example-ios-build-check.yml b/.github/workflows/example-ios-build-check.yml index ec1a5cdaac2..0a401ae9eed 100644 --- a/.github/workflows/example-ios-build-check.yml +++ b/.github/workflows/example-ios-build-check.yml @@ -4,7 +4,7 @@ env: on: pull_request: paths: - - .github/workflows/ios-build.yml + - .github/workflows/example-ios-build-check.yml - packages/react-native-reanimated/RNReanimated.podspec - packages/react-native-reanimated/scripts/reanimated_utils.rb - packages/react-native-reanimated/apple/** @@ -20,7 +20,7 @@ on: branches: - main paths: - - .github/workflows/ios-build.yml + - .github/workflows/example-ios-build-check.yml - packages/react-native-reanimated/RNReanimated.podspec - packages/react-native-reanimated/scripts/reanimated_utils.rb - packages/react-native-reanimated/apple/** @@ -45,43 +45,15 @@ jobs: - name: Check out Git repository uses: actions/checkout@v4 - # TODO: Rework caching in this CI for monorepo setup. - - name: Restore node_modules from cache - uses: actions/cache@v3 - with: - path: . - key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }} - restore-keys: ${{ runner.os }}-node-modules- - - name: Restore app node_modules from cache - uses: actions/cache@v3 - with: - path: ${{ matrix.working-directory }}/node_modules - key: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/yarn.lock', matrix.working-directory)) }} - restore-keys: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}- - name: Install monorepo node dependencies run: yarn install --immutable - - - name: Restore Pods from cache - uses: actions/cache@v3 - with: - path: | - ${{ matrix.working-directory }}/ios/Pods - ~/Library/Caches/CocoaPods - ~/.cocoapods - key: ${{ runner.os }}-pods-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/ios/Podfile.lock', matrix.working-directory)) }} - + # TODO: Add caching for node_modules and artifacts that will work with monorepo setup. - name: Install Pods working-directory: ${{ matrix.working-directory }}/ios run: | bundle install bundle exec pod install - - name: Restore build artifacts from cache - uses: actions/cache@v3 - with: - path: ~/Library/Developer/Xcode/DerivedData - key: ${{ runner.os }}-ios-derived-data-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/ios/Podfile.lock', matrix.working-directory)) }} - - name: Build app working-directory: ${{ matrix.working-directory }} run: npx react-native run-ios --no-packager diff --git a/.github/workflows/example-macos-build-check.yml b/.github/workflows/example-macos-build-check.yml index 8b7b49df27f..c2bab76c5fb 100644 --- a/.github/workflows/example-macos-build-check.yml +++ b/.github/workflows/example-macos-build-check.yml @@ -4,7 +4,7 @@ env: on: pull_request: paths: - - .github/workflows/macos-build.yml + - .github/workflows/example-macos-build-check.yml - packages/react-native-reanimated/RNReanimated.podspec - packages/react-native-reanimated/scripts/reanimated_utils.rb - packages/react-native-reanimated/apple/** @@ -19,7 +19,7 @@ on: branches: - main paths: - - .github/workflows/macos-build.yml + - .github/workflows/example-macos-build-check.yml - packages/react-native-reanimated/RNReanimated.podspec - packages/react-native-reanimated/scripts/reanimated_utils.rb - packages/react-native-reanimated/apple/** @@ -40,8 +40,7 @@ jobs: steps: - name: Check out Git repository uses: actions/checkout@v4 - - # TODO: Rework caching in this CI for monorepo setup. + # TODO: Add caching for node_modules and artifacts that will work with monorepo setup. - name: Install monorepo node dependencies run: yarn install --immutable diff --git a/.github/workflows/example-next-build-check-and-test.yml b/.github/workflows/example-next-build-check-and-test.yml index 2109f7f0a46..b0cdbcefb77 100644 --- a/.github/workflows/example-next-build-check-and-test.yml +++ b/.github/workflows/example-next-build-check-and-test.yml @@ -4,7 +4,7 @@ env: on: pull_request: paths: - - .github/workflows/build-next-example.yml + - .github/workflows/example-next-build-check-and-test.yml - 'packages/react-native-reanimated/src/**' - 'packages/react-native-reanimated/NextExample/**' push: diff --git a/.github/workflows/example-tvos-build-check.yml b/.github/workflows/example-tvos-build-check.yml index 31b7f33ca46..99b1702c378 100644 --- a/.github/workflows/example-tvos-build-check.yml +++ b/.github/workflows/example-tvos-build-check.yml @@ -4,7 +4,7 @@ env: on: pull_request: paths: - - .github/workflows/tvos-build.yml + - .github/workflows/example-tvos-build-check.yml - packages/react-native-reanimated/RNReanimated.podspec - packages/react-native-reanimated/scripts/reanimated_utils.rb - packages/react-native-reanimated/apple/** @@ -18,7 +18,8 @@ on: branches: - main paths: - - .github/workflows/tvos-build.yml + + - .github/workflows/example-tvos-build-check.yml - packages/react-native-reanimated/RNReanimated.podspec - packages/react-native-reanimated/scripts/reanimated_utils.rb - packages/react-native-reanimated/apple/** @@ -41,52 +42,21 @@ jobs: - name: Install monorepo node dependencies run: yarn install --immutable - - - name: Restore Reanimated node_modules from cache - uses: actions/cache@v3 - with: - path: packages/react-native-reanimated/node_modules - key: ${{ runner.os }}-tvos-node-modules-reanimated-${{ hashFiles('packages/react-native-reanimated/yarn.lock') }} - restore-keys: ${{ runner.os }}-tvos-node-modules-reanimated- - + # TODO: Add caching for node_modules and artifacts that will work with monorepo setup. - name: Install Reanimated node_modules working-directory: packages/react-native-reanimated run: yarn install --immutable - - name: Restore app node_modules from cache - uses: actions/cache@v3 - with: - path: ${{ env.WORKING_DIRECTORY }}/node_modules - key: ${{ runner.os }}-tvos-node-modules-${{ env.WORKING_DIRECTORY }}-${{ hashFiles(format('{0}/yarn.lock', env.WORKING_DIRECTORY)) }} - restore-keys: ${{ runner.os }}-tvos-node-modules-${{ env.WORKING_DIRECTORY }}- - - name: Install app node_modules working-directory: ${{ env.WORKING_DIRECTORY }} run: yarn install --immutable - - name: Restore Pods from cache - uses: actions/cache@v3 - with: - path: | - ${{ env.WORKING_DIRECTORY }}/ios/Pods - ~/Library/Caches/CocoaPods - ~/.cocoapods - key: ${{ runner.os }}-tvos-pods-${{ env.WORKING_DIRECTORY }}-${{ hashFiles(format('{0}/ios/Podfile.lock', env.WORKING_DIRECTORY)) }} - - name: Install Pods working-directory: ${{ env.WORKING_DIRECTORY }}/ios run: | bundle install bundle exec pod install - - name: Restore build artifacts from cache - uses: actions/cache@v3 - with: - path: | - ${{ env.WORKING_DIRECTORY }}/ios/build - ~/Library/Developer/Xcode/DerivedData - key: ${{ runner.os }}-tvos-build-${{ env.WORKING_DIRECTORY }}-${{ hashFiles(format('{0}/ios/Podfile.lock', env.WORKING_DIRECTORY)) }} - - name: Build app working-directory: ${{ env.WORKING_DIRECTORY }} run: yarn react-native-tvos run-ios --no-packager --scheme TVOSExample-tvOS --simulator "Apple TV" diff --git a/.github/workflows/expo-devclient-build-check-nightly.yml b/.github/workflows/expo-devclient-build-check-nightly.yml index 225e9372fac..7c3b080badc 100644 --- a/.github/workflows/expo-devclient-build-check-nightly.yml +++ b/.github/workflows/expo-devclient-build-check-nightly.yml @@ -5,7 +5,7 @@ env: on: pull_request: paths: - - .github/workflows/check-expo-dev-client-nightly.yml + - .github/workflows/expo-devclient-build-check-nightly.yml schedule: - cron: '0 0 * * *' # after publishing new nightly version on NPM workflow_dispatch: diff --git a/.github/workflows/monorepo-app-reanimated-build-check-nightly.yml b/.github/workflows/monorepo-app-reanimated-build-check-nightly.yml index b4ce300ab93..26c623dcd7b 100644 --- a/.github/workflows/monorepo-app-reanimated-build-check-nightly.yml +++ b/.github/workflows/monorepo-app-reanimated-build-check-nightly.yml @@ -2,8 +2,8 @@ name: Monorepo app Reanimated build check [Nightly] on: pull_request: paths: - - .github/workflows/build-monorepo.yml - - .github/workflows/build-monorepo-action.yml + - .github/workflows/monorepo-app-reanimated-build-check-nightly.yml + - .github/workflows/monorepo-app-reanimated-build-check-action.yml - RNReanimated.podspec - packages/react-native-reanimated/scripts/reanimated_utils.rb - packages/react-native-reanimated/android/build.gradle @@ -14,8 +14,8 @@ on: branches: - main paths: - - .github/workflows/build-monorepo.yml - - .github/workflows/build-monorepo-action.yml + - .github/workflows/monorepo-app-reanimated-build-check-nightly.yml + - .github/workflows/monorepo-app-reanimated-build-check-action.yml - packages/react-native-reanimated/RNReanimated.podspec - packages/react-native-reanimated/scripts/reanimated_utils.rb - packages/react-native-reanimated/android/build.gradle diff --git a/.github/workflows/react-native-nightly-reanimated-build-check-nightly.yml b/.github/workflows/react-native-nightly-reanimated-build-check-nightly.yml index ed68da82e87..af7728d829c 100644 --- a/.github/workflows/react-native-nightly-reanimated-build-check-nightly.yml +++ b/.github/workflows/react-native-nightly-reanimated-build-check-nightly.yml @@ -4,7 +4,7 @@ env: on: pull_request: paths: - - .github/workflows/check-react-native-nightly.yml + - .github/workflows/react-native-nightly-reanimated-build-check-nightly.yml schedule: - cron: '37 19 * * *' workflow_dispatch: diff --git a/.github/workflows/reanimated-android-validation.yml b/.github/workflows/reanimated-android-validation.yml index 773ccd94782..e2a40ba70d0 100644 --- a/.github/workflows/reanimated-android-validation.yml +++ b/.github/workflows/reanimated-android-validation.yml @@ -4,7 +4,7 @@ env: on: pull_request: paths: - - '.github/workflows/validate-java.yml' + - '.github/workflows/reanimated-android-validation.yml' - 'packages/react-native-reanimated/android/src/main/java/**' - 'packages/react-native-reanimated/android/build.gradle' - 'packages/react-native-reanimated/scripts/cpplint.sh' @@ -16,7 +16,7 @@ on: branches: - main paths: - - '.github/workflows/validate-java.yml' + - '.github/workflows/reanimated-android-validation.yml' - 'packages/react-native-reanimated/android/src/main/java/**' - 'packages/react-native-reanimated/android/build.gradle' - 'packages/react-native-reanimated/scripts/cpplint.sh' diff --git a/.github/workflows/reanimated-apple-validation.yml b/.github/workflows/reanimated-apple-validation.yml index 5e43bfd7cb6..26edc5ce99d 100644 --- a/.github/workflows/reanimated-apple-validation.yml +++ b/.github/workflows/reanimated-apple-validation.yml @@ -6,7 +6,7 @@ on: branches: - main paths: - - '.github/workflows/validate-ios.yml' + - '.github/workflows/reanimated-apple-validation.yml' - 'packages/react-native-reanimated/apple/**' - 'packages/react-native-reanimated/package.json' - 'packages/react-native-reanimated/scripts/validate-apple.sh' @@ -14,7 +14,7 @@ on: - 'packages/react-native-reanimated/Common/cpp/**' pull_request: paths: - - '.github/workflows/validate-ios.yml' + - '.github/workflows/reanimated-apple-validation.yml' - 'packages/react-native-reanimated/apple/**' - 'packages/react-native-reanimated/package.json' - 'packages/react-native-reanimated/scripts/validate-apple.sh' diff --git a/.github/workflows/reanimated-common-validation.yml b/.github/workflows/reanimated-common-validation.yml index a06522e0352..8847e88b41b 100644 --- a/.github/workflows/reanimated-common-validation.yml +++ b/.github/workflows/reanimated-common-validation.yml @@ -4,12 +4,12 @@ on: branches: - main paths: - - '.github/workflows/validate-cpp.yml' + - '.github/workflows/reanimated-common-validation.yml' - 'packages/react-native-reanimated/scripts/cpplint.sh' - 'packages/react-native-reanimated/Common/cpp/**' pull_request: paths: - - '.github/workflows/validate-cpp.yml' + - '.github/workflows/reanimated-common-validation.yml' - 'packages/react-native-reanimated/scripts/cpplint.sh' - 'packages/react-native-reanimated/Common/cpp/**' merge_group: diff --git a/.github/workflows/reanimated-typescript-compatibility-test-nightly.yml b/.github/workflows/reanimated-typescript-compatibility-test-nightly.yml index a3e24fe3827..99c2a9d8deb 100644 --- a/.github/workflows/reanimated-typescript-compatibility-test-nightly.yml +++ b/.github/workflows/reanimated-typescript-compatibility-test-nightly.yml @@ -4,7 +4,7 @@ env: on: pull_request: paths: - - .github/workflows/check-TS-react-native.yml + - .github/workflows/reanimated-typescript-compatibility-test-nightly.yml schedule: - cron: '37 19 * * *' workflow_dispatch: diff --git a/.github/workflows/static-framework-reanimated-build-check-nightly.yml b/.github/workflows/static-framework-reanimated-build-check-nightly.yml index d2b5f4a2d58..12edb57b0fd 100644 --- a/.github/workflows/static-framework-reanimated-build-check-nightly.yml +++ b/.github/workflows/static-framework-reanimated-build-check-nightly.yml @@ -4,7 +4,7 @@ env: on: pull_request: paths: - - .github/workflows/check-static-framework-nightly.yml + - .github/workflows/static-framework-reanimated-build-nightly.yml schedule: - cron: '37 19 * * *' workflow_dispatch: diff --git a/.github/workflows/url-validation-nightly.yml b/.github/workflows/url-validation-nightly.yml index a1f9fb95120..e3e169d29d8 100644 --- a/.github/workflows/url-validation-nightly.yml +++ b/.github/workflows/url-validation-nightly.yml @@ -4,7 +4,7 @@ env: on: pull_request: paths: - - .github/workflows/detect-broken-urls-nightly.yml + - .github/workflows/url-validation-nightly.yml - packages/react-native-reanimated/scripts/validate-urls.js schedule: - cron: '37 19 * * *' diff --git a/.github/workflows/windows-hosted-app-reanimated-build-check-nightly.yml b/.github/workflows/windows-hosted-app-reanimated-build-check-nightly.yml index 49bb4e367fd..c37406c4a00 100644 --- a/.github/workflows/windows-hosted-app-reanimated-build-check-nightly.yml +++ b/.github/workflows/windows-hosted-app-reanimated-build-check-nightly.yml @@ -4,7 +4,7 @@ env: on: pull_request: paths: - - .github/workflows/build-on-windows-nightly.yml + - .github/workflows/windows-hosted-app-reanimated-build-check-nightly.yml schedule: - cron: '37 19 * * *' workflow_dispatch: diff --git a/.github/workflows/yarn-validation.yml b/.github/workflows/yarn-validation.yml index 5138d8fc223..7255a4c6b19 100644 --- a/.github/workflows/yarn-validation.yml +++ b/.github/workflows/yarn-validation.yml @@ -4,7 +4,7 @@ env: on: pull_request: paths: - - '.github/workflows/validate-yarn.yml' + - '.github/workflows/yarn-validation.yml' - '**/package.json' - '**/yarn.lock' merge_group: @@ -14,7 +14,7 @@ on: branches: - main paths: - - '.github/workflows/validate-yarn.yml' + - '.github/workflows/yarn-validation.yml' - '**/package.json' - '**/yarn.lock'