Summary:
This adds `ccache` on the Android build to speedup the building process.
## Changelog:
[INTERNAL] - Adding ccache for Android builds
Pull Request resolved: https://github.com/facebook/react-native/pull/45662
Test Plan: CI
Reviewed By: cipolleschi
Differential Revision: D60229625
Pulled By: cortinico
fbshipit-source-id: bc7e416f4ed1b4932159feb672947669bfb498d7
Summary:
CircleCI was automatically cancelling an old run if a new commit was pushed on the branch.
GitHub does not have the same behavior enabled by default.
Keep running jobs in a pipeline when there is a new commit is usually wasteful of resources and cost money we can save.
## Changelog:
[Internal] - Cancel old jobs if a new commit is pushed
Pull Request resolved: https://github.com/facebook/react-native/pull/45568
Test Plan: Tested on GHA on this PR
Reviewed By: blakef
Differential Revision: D60035940
Pulled By: cipolleschi
fbshipit-source-id: 88b4dfc8bdd3eded6489a87db285e9544d3a1bcf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45544
## This diff now does 5 things:
1. removes the old way we used `actions/setup-node` to manage the cache itself.
2. it creates a new `update-node-modules-cache` workflow, which is the only job that will update the node modules cache
3. it create a `yarn-install-with-cache` action that should be used install of directly calling `yarn install --non-interactive`. This will load a cache against a hash of `package.json`.
4. updated the cache reaper to aggressively remove everything but the latest `npm-{{ hash('package.json') }}`.
5. removed a `cache-setup`, which couldn't be used (we're using artefacts now).
## Why are we doing this:
The various `node-cache-` keys for platforms and on various branches accounts for a very large proportion of the cache (10-20%).
We don't frequently change these dependencies, and even when we do running `yarn install` after loading the cache will resolve any issues.
Limiting the cache to `main` and aggressively pruning older cache entries will clean up a lot of "small win" caching.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D59917944
fbshipit-source-id: 4be6f1959e8fde642a4f208f7d19aceba2c3262f
Summary:
This moves the `helloworld` app to build from the artifacts produced by build_npm_package so that we don't rebuild ReactNative Android from source 8 times.
It reduces build time of such jobs from 14mins to 4mins, resulting in 80mins of build time for every test_all run.
## Changelog:
[INTERNAL] - Move helloworld to build from artifacts on Android
Pull Request resolved: https://github.com/facebook/react-native/pull/45517
Test Plan: CI
Reviewed By: blakef
Differential Revision: D59957613
Pulled By: cortinico
fbshipit-source-id: b6c4adcf804af6c8d2661cf56549d037e09aa2c1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45542
As we do have several version numbers for external actions all across the codebase,
here I'm aligning all of them to just use the majors.
I'm doing it only for GitHub first party actions as we trust them,
so minor/patch changes can safely be pulled in without code changes.
Changelog:
[Internal] [Changed] - Align github/* action versions on major
Reviewed By: cipolleschi, blakef
Differential Revision: D59959978
fbshipit-source-id: bb07ce0dfd74d9502a2ac0ea90a2b32f55d6d655
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45541
This is another round of letting react-native-bot do the job that the
generic GitHub Action bot was doing.
Changelog:
[Internal] [Changed] - Act On label as react-native-bot
Reviewed By: cipolleschi
Differential Revision: D59959468
fbshipit-source-id: 8e0f7e2e90a40ed2aa265e637c8a809064e22747
Summary:
Nightly/Release workflow are currently broken due to a wrong path reference to a composite action. This fixes it.
## Changelog:
[INTERNAL] - Fix nightly/release workflow
Pull Request resolved: https://github.com/facebook/react-native/pull/45537
Test Plan: CI
Reviewed By: cipolleschi
Differential Revision: D59959185
Pulled By: cortinico
fbshipit-source-id: 02c556d86105eac35e152b4dc09705bc42c8031a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45533
This input is unused and is causing a warning on the build pipeline.
I'm cleaning it up.
Changelog:
[Internal] [Changed] - Remove unused build-from-source input
Reviewed By: blakef
Differential Revision: D59958184
fbshipit-source-id: 23ba010da077342605afaaee122bc7ceabc89915
Summary:
Factor out the Build NPM package job in a separate action for code reuse
## Changelog:
[Internal] - Factor out the Build NPM package job in a separate action for code reuse
Pull Request resolved: https://github.com/facebook/react-native/pull/45493
Test Plan: GHA are green
Reviewed By: robhogan
Differential Revision: D59858572
Pulled By: cipolleschi
fbshipit-source-id: 561a215ba5812352034157aa254999db56fcd31e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45483
We don't really use this functionality and is getting harder to migrate to GHA,
hence I'm removing it.
Changelog:
[Internal] [Changed] - Remove report-app-size
Reviewed By: cipolleschi
Differential Revision: D59822862
fbshipit-source-id: 2d082454aea3b3c5863bd34556a23c2fc847f841
Summary:
This change adds a job that runs 2 hours after the nightlies. This jobs returns successfully if the nightly has been published or it report an error in case it has failed.
We will hook this signal to the internal system to be notified about Nightlies failures
## Changelog:
[Internal] - Add jobs to check for nightlies
Pull Request resolved: https://github.com/facebook/react-native/pull/45509
Test Plan: Test the Action on GHA
Reviewed By: blakef
Differential Revision: D59907442
Pulled By: cipolleschi
fbshipit-source-id: 3b35aa2ad69b376c65a765f740a1d6e6ed8ad99f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45508
The scripts/clean-gha-cache.js uses the `gh` cli too, which expects the GITHUB_TOKEN presented GH_TOKEN. Also allowed us to manually kick off this workflow.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D59901639
fbshipit-source-id: f3543cc83cbf67b6969abc3390790e038e06c305
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45474
Our actions inputs are now a mixture of different casing.
I'm moving everything to be kebab-case
Changelog:
[Internal] [Changed] - Composite actions inputs should be kebab-case
Reviewed By: cipolleschi
Differential Revision: D59809181
fbshipit-source-id: af6d541c2b4f5fa162dcde412fb8808bae1ef2d3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45480
We currently use the default GITHUB_ACTION which makes a lot of interaction
appear as user "GitHub Actions". Instead we could use the `REACT_NATIVE_BOT_GITHUB_TOKEN`
which we have as secret so the bot will actually perform the actions.
Changelog:
[Internal] [Changed] - Act as react-native-bot on all the actions
Reviewed By: cipolleschi
Differential Revision: D59815201
fbshipit-source-id: 702b121ec07d0db10abf25e23f7ddf5658dd5d62
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45491
The build_android job was missing the sonatype credentials so could not
publish a -SNAPSHOT version. This fixes it.
Changelog:
[Internal] [Changed] - Unbreak nightlies by fixing secrets
Reviewed By: cipolleschi
Differential Revision: D59848810
fbshipit-source-id: 2cc1d03b090d0aeb3886590ec0696f9c3a6556b9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45468
This should greatly reduce the time spent on build_npm_package
because we're moving all the publishing logic to build_android.
I need to do a bit more testing with nightlies to make sure that everything is published correctly.
Changelog:
[Internal] [Changed] - Make build_android publish to the stating repositories
Reviewed By: cipolleschi
Differential Revision: D59804015
fbshipit-source-id: be3f0b6e16f5fdbf760ec7a5e16c8e258e06dd28
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45479
This just prints a summary on PRs if the Gradle task fails so it's easier to jump directly
to the failure.
Changelog:
[Internal] [Changed] - Enable add-job-summary-as-pr-comment for failed jobs
Reviewed By: cipolleschi
Differential Revision: D59812845
fbshipit-source-id: 2069a1c8db7d264ca1af3c1182fa443cb0a69646
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45475
Instead of zipping all the RNTester's APK together, let's
upload them per buildVariant so it's easier to retrieve them later.
Changelog:
[Internal] [Changed] - Split the rntester APK artifacts in 4
Reviewed By: cipolleschi
Differential Revision: D59809721
fbshipit-source-id: 2d375475d5cee71c212f4d1f3a4a9edf3442358f
Summary:
We don't need to specify a minor/patch for actions/upload-artifact.
We also have all sorts of different versions scattered around the codebase.
This aligns them to the latest sable in the 4.x series.
Changelog:
[Internal] [Changed] - actions/upload-artifact to v4.x
Reviewed By: cipolleschi
Differential Revision: D59811525
fbshipit-source-id: 7264db097bcb2ff34b3ace467996e8308c0f2034
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45459
Seeing failures on main with GHA for gradle builds, in the Post Setup gradle step:
```
Could not get unknown property 'cleanupTime' for object of type org.gradle.api.internal.cache.DefaultCacheConfigurations.
```
This is a speculative change to get CI back to stable.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D59802517
fbshipit-source-id: c7b5259397fddef9420570043263e92f21718934
Summary:
This change factors out build-android job so we can reuse it
## Changelog:
[Internal] - Factor out the build-android job for code reuse
Pull Request resolved: https://github.com/facebook/react-native/pull/45455
Test Plan: GHA are green
Reviewed By: blakef
Differential Revision: D59802116
Pulled By: cipolleschi
fbshipit-source-id: 12ece8004da3bfd1f275b4af8e9822d4b0ccc0f0
Summary:
This is just a minor nit to make it easier to copy-n-paste
## Changelog:
[INTERNAL] - Remove extra dot from close-pr.yml
Pull Request resolved: https://github.com/facebook/react-native/pull/45441
Test Plan: N/A
Reviewed By: cipolleschi
Differential Revision: D59752879
Pulled By: cortinico
fbshipit-source-id: caa398010b64024e2a0259d177762fd76082507f
Summary:
This change factors out the build hermesc windows job into a separate action to reuse the code in different jobs
## Changelog:
[Internal] - Factor out build hermesc windows for code reuse
Pull Request resolved: https://github.com/facebook/react-native/pull/45432
Test Plan: GHA are green
Reviewed By: blakef
Differential Revision: D59748955
Pulled By: cipolleschi
fbshipit-source-id: bb6b96c93ec7ba6af1a210511ec672907f237b45
Summary:
Call the react-native-community/template GHA to trigger a new release when we publish a react-native release. This then waits to confirm that the package is published.
See react-native-community/template#36 for the matching change
Changelog: [General][Added] trigger template publish
Pull Request resolved: https://github.com/facebook/react-native/pull/45327
Test Plan: Not sure on the best way forward here.
Reviewed By: cipolleschi
Differential Revision: D59467829
Pulled By: blakef
fbshipit-source-id: 091269e7ecdae5801ac7c03a1ede54452ae99b24
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45417
Add sources for `folly::detail::base64` to our existing `folly` dependency for Android and iOS OSS build toolchains, now a (tiny) dependency of the JS debugger since D54309633, and already part of Folly's Buck sources.
Changelog: [Internal]
Reviewed By: cipolleschi, blakef
Differential Revision: D59685218
fbshipit-source-id: bac33402927f310bf867d2c47b4ebbb9276cf545
Summary:
This change factors out the Build HermesC for Linux job so that we can reuse the code in various workflows
## Changelog:
[Internal] - Factor out build-hermesc-linux for code reuse
Pull Request resolved: https://github.com/facebook/react-native/pull/45402
Test Plan: GHA are green
Reviewed By: cortinico
Differential Revision: D59673895
Pulled By: cipolleschi
fbshipit-source-id: f5c680d523866442d25317e880b4803ac89c3741
Summary:
Factor out the build-hermes-macos job to reuse the code
## Changelog:
[Internal] - Factor out build hermes macos action
Pull Request resolved: https://github.com/facebook/react-native/pull/45371
Test Plan: GHA are green
Reviewed By: blakef
Differential Revision: D59627977
Pulled By: cipolleschi
fbshipit-source-id: 84226d8a2c036f816fa8ea949b467873a7eef37c
Summary:
Factor out build-apple-slices-hermes to a seprate action to reuse code
## Changelog:
[Internal] - Refactor the CI to reuse code
Pull Request resolved: https://github.com/facebook/react-native/pull/45359
Test Plan: GHA are green
Reviewed By: cortinico
Differential Revision: D59575467
Pulled By: cipolleschi
fbshipit-source-id: 5d253f3dd523cb70b768c62db10fb7ff39fbd49f
Summary:
Factor out the action to build hermesc for apple platform so we can reuse it across jobs
## Changelog:
[Internal] - Factor out hermesC apple to reuse code
Pull Request resolved: https://github.com/facebook/react-native/pull/45346
Test Plan: GHA are green
Reviewed By: cortinico
Differential Revision: D59521564
Pulled By: cipolleschi
fbshipit-source-id: c99966e314b3d418d1d83d653c0be68b2931b03b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45318
I'm setting the Gradle cache to write-only for build_android on main/stable branches.
This is so we start from a fresh cache on those jobs (as they're not on the critical path for developers).
Changelog:
[Internal] [Changed] - Attempt to limit the Gradle cache size
Reviewed By: cipolleschi
Differential Revision: D59466459
fbshipit-source-id: 8b7936ebe053ae06256f8506093eb17c07219de9
Summary:
We do have a mixture of casing in the custom GH actions in our repo.
This aligns them all to be `kebab-case`
## Changelog:
[INTERNAL] - Aling all custom actions to kebab-case
Pull Request resolved: https://github.com/facebook/react-native/pull/45286
Test Plan: CI
Reviewed By: blakef
Differential Revision: D59374046
Pulled By: cortinico
fbshipit-source-id: 030a9323e501e375585e90f10a3b29c3bb671b28
Summary:
This migrates `analyse_code` to GHA into a single job called `lint`.
## Changelog:
[INTERNAL] - Migrate analyse_code to GHA
Pull Request resolved: https://github.com/facebook/react-native/pull/45247
Test Plan: CI
Reviewed By: NickGerleman
Differential Revision: D59283393
Pulled By: cortinico
fbshipit-source-id: dcdc4828a551062b3706e6450614b8c94e1a7e81
Summary:
This migrates the `test_js` workflow to GHA
## Changelog:
[INTERNAL] - Migrate test_js to GHA
Pull Request resolved: https://github.com/facebook/react-native/pull/45246
Test Plan: Will wait for CI
Reviewed By: javache
Differential Revision: D59270333
Pulled By: cortinico
fbshipit-source-id: e77eb9819e0819638c51e61b1e477ac04680a2f4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45233
We want the Gradle cache to be written only on main/-stable branches run, and only for jobs with `cache-read-only` == false (i.e. `build_android`).
This changes implements it.
Changelog:
[Internal] [Changed] - Further refine the Gradle caching logic.
Reviewed By: blakef
Differential Revision: D59225944
fbshipit-source-id: b6c3a5d4d0d399d6fe42287976925c43f3f12eb7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45231
Following up to cipolleschi's work, it turns out that me setting this command inside
the docker file for React Android is unneffective:
https://github.com/react-native-community/docker-android/pull/228
The reason is that the user executing is different (1001 for the Dockerfile, while GHA executes as root 1000).
So we need to set this, otherwise the nightlies will be invoked with the `-TEMP` prefix:
Changelog:
[Internal] [Changed] - Setup `git config --global --add safe.directory '*'` when running jobs inside Docker
Reviewed By: blakef
Differential Revision: D59223862
fbshipit-source-id: 26674fc8cdaebf6687407072cc4e4f5c38246845
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45161
This is part of a bigger refactoring of the Android pipelines.
As `build_android` is already building everything, let's save the maven-local
so it can be reused by other jobs (test_android_helloworld and build_npm_package).
Changelog:
[Internal] [Changed] - Let build_android produce a signed maven-local.zip archive
Reviewed By: cipolleschi, blakef
Differential Revision: D59002893
fbshipit-source-id: db03946c975b2ce91dae0c4011981b2fe9dd6113
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45133
Recently, CircleCI has failed pretty often due to these tests.
The reason is that we migrated these jobs to M1 machines, as circleCI is deprecating intel ones, and on these machines the simulators tend to freeze. Hence, every often we get stuck when running the tests. :(
We are going to move to GHA, so that should not be a big issue.
## Changelog:
[Internal] - Disable unit tests in CircleCI to improve CI robustness
Reviewed By: cortinico
Differential Revision: D58948614
fbshipit-source-id: 5420bdf0fda325779a4e287e7b00c623de822ccb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45175
This change ports the CI improvements we made on stable branch to main.
## Changelog:
[Internal] - Port back to main improvements we made in GHA
Reviewed By: cortinico
Differential Revision: D59053873
fbshipit-source-id: 73eb7e33b9bbdc5d8c3a9294f487ad969b144bf3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45184
This is a follow-up to D59055522.
> NOTE:This diff will be followed up by a merge of the set-rn-version script into set-version. (I had considered a rename to version-rn-artifacts, intentionally keeping this script separate and distinct from a future [lerna version + this script] setup — however the current UX and confusion with this naming would be too confusing. It can move into a util 👍🏻.)
- Rename `set-rn-version` to `set-rn-artifacts-version` (more accurate).
- Mark this script as deprecated.
- For now, there are too many references to this script in CI test jobs to refactor away this entry point, so I am avoiding this — these should later be standardised to `set-version`.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D59058085
fbshipit-source-id: 4123ac73b5c7a2e07a1d1b6da61e0ad94fc31f84
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45160
This should optimize the Gradle cache, so that only `build_android` which
effectively builds everything Android related, should be allowed to write there.
More info on this strategy here:
https://github.com/gradle/actions/blob/main/docs/setup-gradle.md
Changelog:
[Internal] [Changed] - Only build_android should write to the Gradle Cache
Reviewed By: cipolleschi
Differential Revision: D59002323
fbshipit-source-id: 31b815747efdf93bfc7baf97799e287c8dcd7f02
Summary:
The cache checks in GHA were performed against bool values, while the actual values are strings.
So the checks were always failing and all the steps were executed, even when not necessary.
The reason why it was failing is because, with this setup, when a cache is hit, some steps were skipped in previous jobs, making following jobs trying to execute code on not-existing files.
## Changelog:
[Internal] - Fix cache for build_hermes_macos
Pull Request resolved: https://github.com/facebook/react-native/pull/45127
Test Plan: GHA are green again
Reviewed By: blakef
Differential Revision: D58947838
Pulled By: cipolleschi
fbshipit-source-id: 8dba216e72a3034fd4c1484418d37bfb78cf314d