react-native icon indicating copy to clipboard operation
react-native copied to clipboard

convert circleci workflows to github actions

Open robandpdx opened this issue 1 year ago • 2 comments

Summary:

This pull request converts the CircleCI workflows to GitHub actions workflows.

The github actions workflow is meant to mimic this circleci workflow.

Errors

test_ios_rntester jobs fails with errors.

build_npm_package job fails with an error indicating that the artifacts are not found. We may need to use upload-artifact and download-artifact rather than cache for these files.

test-windows job fails with unit test errors. See the log for details.

Questions

build_android and build_npm_package jobs take a parameter release_type. When and how does this get passed in?

Test Plan:

These workflows were tested in my fork. Here are the latest workflow runs:
test-all
test-js

https://fburl.com/workplace/f6mz6tmw

robandpdx avatar Feb 08 '24 19:02 robandpdx

Fails
:no_entry_sign:

:clipboard: Missing Changelog - Please add a Changelog to your PR description. See Changelog format

Generated by :no_entry_sign: dangerJS against a245a851dc1b3d73ba358b61f0adcba7fa1446b6

github-actions[bot] avatar Feb 08 '24 19:02 github-actions[bot]

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 18,012,519 -114,569
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 21,371,039 -122,787
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: fb42a55bdfcc524228e0650fbdc1b7333ce0f27b Branch: main

analysis-bot avatar Feb 08 '24 19:02 analysis-bot

Very exciting 🙂.

@cortinico and @cipolleschi will be the experts on the existing setup, but I also took a quick look, and noticed a couple quick things:

  1. The path-based workflow selection is a lot cleaner than the previous job selection script, and takes a workflow out of the critical path for all other workflows. I don't think the logic is exactly the same though. @cipolleschi wrote this and would be able to review and give feedback.
  2. The test_ios_rntester jobs seem to be failing because of too old XCode version. We previously had a matrix where most jobs ran using XCode 15.0.1, with a couple running on 14.3 to test compat with slightly older versions. IIRC the macos-12 hosted runner has both installed, but defaulted to 14.2, so we can just xcode-select or use a preexisting action to do that. That upper-bound should actually probably now be XCode 15.1, but IIRC that had some trouble with CircleCI setup. Also a reminder to @cipolleschi wrt lower bound, since I know that came up recently (14.3 requirement should be in changelog as breaking change, if we don't want to bump to 15 min required for 0.74)
  3. The build-android job, which doesn't use much cache except for tools already installed in the Docker container, seems to run about half the speed of the previous CircleCI job. Wondering if some of these should maybe be on larger runners.

NickGerleman avatar Feb 09 '24 21:02 NickGerleman

@cortinico and @cipolleschi, I have updated this PR to only include the jobs that are succeeding in my fork. Please merge this as we discussed. I'll follow up with other PRs as I get more jobs working. Thanks again for the help!

Here is the latest build of these changes in my branch.

robandpdx avatar Feb 26 '24 20:02 robandpdx

/rebase - this command should automatically rebase this PR on top of main

cipolleschi avatar Feb 28 '24 11:02 cipolleschi

/rebase

cortinico avatar Mar 01 '24 02:03 cortinico

@cortinico @cipolleschi I have rebased my branch today. Here is the latest workflow run in my fork.

If you approve this workflow run, you should see the same results.

robandpdx avatar Mar 05 '24 15:03 robandpdx

If you approve this workflow run, you should see the same results.

So CircleCI jobs are currently red as we bumped packages on main to 0.75.0-main. @huntie are you looking into it?

cortinico avatar Mar 05 '24 16:03 cortinico

@cortinico Fixed after both of:

  • https://github.com/facebook/react-native/pull/43323#
  • https://github.com/facebook/react-native/pull/43331

huntie avatar Mar 06 '24 15:03 huntie

@cortinico @cipolleschi Here is the latest workflow run from my fork. All green now. It would be great to get this merged soon.

robandpdx avatar Mar 07 '24 00:03 robandpdx

Here is the latest workflow run from my fork. All jobs should be green now.

Amazing work @robandpdx ! I've noticed that the test_android_template* and test_ios_template* jobs are still missing, right?

How do we want to split this work to start merging it? Should we do the Android first?

cortinico avatar Mar 07 '24 12:03 cortinico

@cortinico The test_android_template* and test_ios_template* jobs are in progress and I'll follow up with another PR to add them. These jobs are dependent upon the build_npm_package job (at least that how it's configured in circleci), which I don't have working currently. Any help with the errors there is appreciated.

robandpdx avatar Mar 07 '24 22:03 robandpdx

@cortinico The test_android_template* and test_ios_template* jobs are in progress and I'll follow up with another PR to add them. These jobs are dependent upon the build_npm_package job (at least that how it's configured in circleci), which I don't have working currently. Any help with the errors there is appreciated.

Sure so a couple of pointers:

  1. That's the first time I see this error, but apparently Gradle is failing to produce the .aar for React Native Android that needs to be consumed by the users.
  2. I would first check if this is working fine:

https://github.com/robandpdx-org/react-native/blob/39c5c057fd7656009e2250f223c66ceeabf5e178/.github/workflows/test-all.yml#L790-L794

As the error message contains x86:

Could not add file '/__w/react-native/react-native/packages/react-native/ReactAndroid/build/intermediates/prefab_package/release/prefab/modules/react_render_uimanager/libs/android.x86/libreact_render_uimanager.a' to ZIP '/__w/react-native/react-native/packages/react-native/ReactAndroid/build/outputs/aar/ReactAndroid-release.aar'.

which is suspicious. For dry-run we produce only arm64-v8a.

  1. I would go here: https://github.com/robandpdx-org/react-native/blob/cd486bcfecb58c715d016b4d748179398990815b/scripts/releases/utils/release-utils.js#L26

and do this:

- if (exec('./gradlew publishAllToMavenTempLocal').code) {
+ if (exec('./gradlew publishAllToMavenTempLocal --info --stacktrace').code) {

to add more logging. This can provide a bit more insights on why the job is failing at the moment.

cortinico avatar Mar 08 '24 11:03 cortinico

@cortinico I think it's best if I hand off this work to you or someone else who has the expertise to make it work.

robandpdx avatar Mar 11 '24 17:03 robandpdx

@cortinico I think it's best if I hand off this work to you or someone else who has the expertise to make it work.

Can we do the following:

  1. Can you give me push rights to your fork so I can experiment a bit?
  2. Could you start sending over smaller PRs for everything that is green so far? The smaller you can make them the better so I can distribute it for review to other colleagues.

cortinico avatar Mar 12 '24 12:03 cortinico

@cortinico I have given you write permission to my fork.

In order to deliver small PRs, I would need a tool that can do stacked diffs across forks. I'm not aware of any such tool that supports stacked diffs across forks. The best I can do is get everything in this PR green.

robandpdx avatar Mar 13 '24 21:03 robandpdx

@cortinico I have opened this PR with only the android build and test.

robandpdx avatar Mar 26 '24 03:03 robandpdx