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

convert circleci workflows to github actions #42931

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

robandpdx
Copy link
Contributor

@robandpdx robandpdx commented Feb 8, 2024

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

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 8, 2024
Copy link

github-actions bot commented Feb 8, 2024

Fails
🚫

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

Generated by 🚫 dangerJS against a245a85

@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Feb 8, 2024
@analysis-bot
Copy link

analysis-bot commented Feb 8, 2024

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: fb42a55
Branch: main

@NickGerleman
Copy link
Contributor

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.

packages/react-native-codegen/lib
enableCrossOsArchive: true
test_android:
runs-on: ubuntu-latest
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
runs-on: ubuntu-latest
runs-on: 8-core-ubuntu

mkdir -p "$DEST_DIR"
mv "hermes.framework.dSYM" "$DEST_DIR"
test_ios_rntester_ruby_3_2_0:
runs-on: macos-12
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
runs-on: macos-12
runs-on: macos-12-large

@robandpdx robandpdx force-pushed the convert-circleci-to-github-actions branch 2 times, most recently from 7228178 to 4d11b9b Compare February 26, 2024 19:30
@robandpdx
Copy link
Contributor Author

@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.

@cipolleschi
Copy link
Contributor

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

@cortinico
Copy link
Contributor

/rebase

@robandpdx robandpdx force-pushed the convert-circleci-to-github-actions branch 3 times, most recently from 44027d5 to 0983cca Compare March 5, 2024 14:24
@robandpdx
Copy link
Contributor Author

@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.

@cortinico
Copy link
Contributor

cortinico commented Mar 5, 2024

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?

@huntie
Copy link
Member

huntie commented Mar 6, 2024

@robandpdx robandpdx force-pushed the convert-circleci-to-github-actions branch 2 times, most recently from 76490bb to 0cc63a2 Compare March 6, 2024 22:23
@robandpdx robandpdx force-pushed the convert-circleci-to-github-actions branch from 0cc63a2 to 16b4cdb Compare March 7, 2024 00:46
@robandpdx
Copy link
Contributor Author

robandpdx commented Mar 7, 2024

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

@cortinico
Copy link
Contributor

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?

Copy link
Member

@huntie huntie left a comment

Choose a reason for hiding this comment

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

Just spotting a few nits.

.github/actions/cache_setup/action.yml Outdated Show resolved Hide resolved
.github/workflows/test-all.yml Outdated Show resolved Hide resolved
.github/workflows/test-all.yml Outdated Show resolved Hide resolved
robandpdx and others added 3 commits March 7, 2024 17:39
rename step to be more concise

Co-authored-by: Alex Hunt <hello@alexhunt.io>
rename step

Co-authored-by: Alex Hunt <hello@alexhunt.io>
@robandpdx
Copy link
Contributor Author

robandpdx commented Mar 7, 2024

@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.

@cortinico
Copy link
Contributor

@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.

@robandpdx
Copy link
Contributor Author

@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.

@cortinico
Copy link
Contributor

@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.

@robandpdx
Copy link
Contributor Author

@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
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants