Commit Graph

31 Commits

Author SHA1 Message Date
Fabrizio Cucci
d6f2b34a95 Back out "Use stable Hermes for dry-run builds on stable branches" (#55877)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55877

Changelog: [Internal]

Original commit changeset: d5888a00b29c

Original Phabricator Diff: D95022571

It turns out, this didn't fix the issue.

Reviewed By: cipolleschi

Differential Revision: D95051094

fbshipit-source-id: f99ecc0b76a1bdf4ba2eb3117b08754dfbbc2558
2026-03-03 06:07:55 -08:00
Fabrizio Cucci
cac978be7f Use stable Hermes for dry-run builds on stable branches (#55867)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55867

Changelog: [Internal]

The build_android workflow was incorrectly using for dry-run
builds on stable branches (e.g., 0.85-stable), causing it to append  suffix
to the Hermes version. This resulted in trying to fetch non-existent SNAPSHOT artifacts
like in https://github.com/facebook/react-native/actions/runs/22592250332/job/65471130298.

This fix adds a check to detect stable branches (via github.ref_name or github.base_ref)
and uses  instead, which fetches the stable Hermes release from
Maven Central without the -SNAPSHOT suffix.

We check both github.ref_name and github.base_ref to cover two scenarios:
* ref_name: Direct pushes to stable branches (e.g. pushing to 0.85-stable)
* base_ref: Pull requests targeting stable branches (e.g. cherry-pick PRs where the source branch isn't named -stable but the target is)

Reviewed By: cipolleschi

Differential Revision: D95022571

fbshipit-source-id: d5888a00b29c9b5a22328fa794070c317671db2b
2026-03-03 04:07:14 -08:00
Riccardo Cipolleschi
aefe0f59e2 Skip set-rn-artifacts-version for PRs targeting stable branches (#55809)
Summary:
When a PR targets a `-stable` branch, `github.ref_name` is the PR branch (not ending in `-stable`), so the version script was incorrectly running. Added a check for `github.base_ref` to also skip the script when the PR target branch is a stable branch.

## Changelog:
[Internal] - Skip set-rn-artifacts-version for PRs targeting stable branches

Pull Request resolved: https://github.com/facebook/react-native/pull/55809

Test Plan: CI should pass without running the artifacts version script on PRs targeting stable branches.

Reviewed By: cortinico

Differential Revision: D94678295

Pulled By: cipolleschi

fbshipit-source-id: 5809ec710c191075f1bc1528ecff95f8bd745257
2026-03-02 05:21:32 -08:00
Nicola Corti
9d1c55b113 Simplify the jq command used to read version inside build_android (#55057)
Summary:
This is a pick of 4cac35f7d0 inside `main`.
The commit is already on the `0.84-stable` branch.

The reasoning here is that `cat` + `jq` failed to run with:

```
Run echo "rn-version=$(cat packages/react-native/package.json | jq -r 'version')" >> $GITHUB_OUTPUT
  echo "rn-version=$(cat packages/react-native/package.json | jq -r 'version')" >> $GITHUB_OUTPUT
  shell: bash --noprofile --norc -e -o pipefail {0}
jq: error: version/0 is not defined at <top-level>, line 1:
version
jq: 1 compile error
```

I'm moving to a single `jq` invocation as it's more resilient.

## Changelog:

[INTERNAL] -

Pull Request resolved: https://github.com/facebook/react-native/pull/55057

Test Plan: N/A

Reviewed By: fabriziocucci, alanleedev

Differential Revision: D90189240

Pulled By: cortinico

fbshipit-source-id: 9b1cd6ad6d37913f8a468892cedce5f808c8c33e
2026-01-07 03:00:44 -08:00
Riccardo Cipolleschi
dcfe7f50f9 Set the release version also to test RC.0 (#55054)
Summary:
This is a cherry-pick of dc90b0b7f3 on main from 0.83 and 0.84

## Changelog:

[INTERNAL] -

Pull Request resolved: https://github.com/facebook/react-native/pull/55054

Test Plan: CI

Reviewed By: cipolleschi

Differential Revision: D90174387

Pulled By: cortinico

fbshipit-source-id: 74b0ec3b853f2654ce140b9af27f13fe22c81f4a
2026-01-06 06:51:24 -08:00
Jakub Piasecki
076e6a1d53 Use prebuilt Hermes by default when building Android (#54707)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54707

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D87929652

fbshipit-source-id: 439eef5eea9b9203cf2a7b5a8eae38d83e192bd5
2025-12-15 08:13:16 -08:00
Salman Muin Kayser Chishti
b9ac40876e chore(ci): update GitHub Actions to latest versions with Node.js 24 support (#54885)
Summary:
Updates all `actions/*` GitHub Actions to their latest versions to ensure compatibility with Node.js 24 and prepare for the [deprecation of Node.js 20 on GitHub Actions runners](https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/).

## Changelog:

[Internal] [Changed] - Updated GitHub Actions to latest versions with Node.js 24 support

## Version Updates

| Action | Previous | Current | Release Notes |
|--------|----------|---------|---------------|
| `actions/checkout` | v4 | **v6** | [v6.0.0](https://github.com/actions/checkout/releases/tag/v6.0.0) |
| `actions/github-script` | v6 | **v8** | [v8.0.0](https://github.com/actions/github-script/releases/tag/v8.0.0) |
| `actions/setup-node` | v4 | **v6** | [v6.0.0](https://github.com/actions/setup-node/releases/tag/v6.0.0) |
| `actions/setup-java` | v2/v4 | **v5** | [v5.0.0](https://github.com/actions/setup-java/releases/tag/v5.0.0) |
| `actions/upload-artifact` | v4/v4.3.4 | **v6** | [v6.0.0](https://github.com/actions/upload-artifact/releases/tag/v6.0.0) |
| `actions/download-artifact` | v4/v4.1.3 | **v7** | [v7.0.0](https://github.com/actions/download-artifact/releases/tag/v7.0.0) |
| `actions/cache` | v4 | **v5** | [v5.0.0](https://github.com/actions/cache/releases/tag/v5.0.0) |
| `actions/stale` | v9 | **v10** | [v10.0.0](https://github.com/actions/stale/releases/tag/v10.0.0) |

## Why

GitHub is [deprecating Node.js 20](https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/) on Actions runners. The new versions of these actions now run on Node.js 24 by default (`runs.using: node24`).

## Requirements

- Minimum Actions Runner version: **v2.327.1**
- Self-hosted runners should be updated before merging

Pull Request resolved: https://github.com/facebook/react-native/pull/54885

Test Plan:
- PR-triggered workflows (`test-all.yml`, `danger-pr.yml`) will validate core CI
- Other workflows will be validated when their respective triggers occur (schedules, releases, issue events)

Reviewed By: christophpurrer

Differential Revision: D89178299

Pulled By: cipolleschi

fbshipit-source-id: 889ca485486710bb3cd12122bef2731113b66077
2025-12-15 04:20:35 -08:00
Nicola Corti
1c5e0ffd9f Do not reset the native artifacts version to 1000.0.0 on release branches (#53817)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53817

What is currently happening, is that the various commits on the release branches like `0.82-stable` are resetting the version of native artifacts to `1000.0.0-<SHA>`.

The reason is that during the `test-all` workflow, we pass the `dry-run` as release type.
That's to prevent the various tools from calling `npm publish` and so on.

The problem is that on the releases branches, the version was already set at branch cut time.
Therefore, we see the version 1000.0.0 reappearing during Android E2E test in the emulator. Similary this is also affecting iOS prebuilds so I'm attempting to fix it here.

Changelog:
[Internal] [Changed] -

Reviewed By: huntie

Differential Revision: D82553599

fbshipit-source-id: 31a52e7df036e700663b3d3dd677973a7a210a30
2025-09-18 10:53:25 -07:00
Nicola Corti
3ea2f62531 Bump ccache cache key on GHA (#52711)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52711

The ccache cache is not really working. That's because we don't have a way to
properly compute the cache.

I'm adding has `hashFiles` to collect all the C++ and CMake files that are used
by ccache to fix this.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D78560946

fbshipit-source-id: 8d521d01386b62d3cfbd485f8e6fcf5f66eba71b
2025-07-21 09:02:04 -07:00
Riccardo Cipolleschi
5c869fd0a5 Run E2E tests on each PR (#52197)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52197

This Diff enables E2E tests to run on every PR.
We estimated that, now that we removed JSC and the legacy arch, the cost of running E2E tests on each PR should not be that high.

## Changelog:
[Internal] - Run E2E tests on each PR

Reviewed By: cortinico

Differential Revision: D77148473

fbshipit-source-id: 68191ff81c197d4c4ff9d6e71a41b7253971ddfb
2025-07-21 08:42:23 -07:00
Riccardo Cipolleschi
ac8d677cb4 Fix E2E tests for Android (both ci and release testing) (#51873)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51873

After [51865](https://github.com/facebook/react-native/pull/51865), the path were the apk are generated changed. That broke the e2E tests in ci and the local script to test E2E, because the artefacts were not uploaded to CI properly.

This change should fix it

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76133191

fbshipit-source-id: 70d8567dee8dc2a8bcc656cca7e94ad19101fe28
2025-06-06 08:55:11 -07:00
Riccardo Cipolleschi
36df97f500 Stop testing JSC (#51475)
Summary:
As next step of the JSC deprecation, we are removing the CI testing for the JSC engine

## Changelog:
[Internal] -

Pull Request resolved: https://github.com/facebook/react-native/pull/51475

Test Plan: GHA

Reviewed By: NickGerleman

Differential Revision: D75089216

Pulled By: cipolleschi

fbshipit-source-id: 3839914cb58e872ddd82089bd7cb1391ddda20c1
2025-05-21 03:31:42 -07:00
Nicola Corti
c4e952ea84 Temporarily disable Configuration Caching on CI (#49742)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49742

Seems like publishing jobs are not happy with Gradle Config Caching.
I'm disabling it for now till we find out what's the root cause.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D70385662

fbshipit-source-id: 532c46ea1e578bab5f3e5d6814a7f7193e67a7ad
2025-02-28 04:25:58 -08:00
Nicola Corti
e49f2d5c50 Enable Gradle Configuration Caching on CI (#49514)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49514

This attemps to enable Config Caching on CI. I'm curious to see how much time this is going to save.
There might be some problems with nigthlies so I want to make sure this is running for some days before the branch cut.

Changelog:
[Internal] [Changed] -

Reviewed By: NickGerleman

Differential Revision: D69846848

fbshipit-source-id: 0d5c292e65a6107df62f6494a1aae9abd0e8b6cc
2025-02-20 02:42:24 -08:00
Nicola Corti
b7eccf23de Back out "Do not reset rn-artifacts-version on release branch" (#48651)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48651

Original commit changeset: dace7c931ec3

Original Phabricator Diff: D67975049

Reviewed By: cipolleschi

Differential Revision: D68114130

fbshipit-source-id: 9fb1707191037127b9ae985d2e3298a64e911590
2025-01-14 07:09:27 -08:00
Nicola Corti
a28d3961bd Do not reset rn-artifacts-version on release branch (#48572)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48572

Because of this extra step on build-android, we're seeing the version 1000.0.0-<SHA>
on commits on the release branch. This prevents it.

Changelog:
[Internal] [Changed] - Do not reset rn-artifacts-version on release branch

Reviewed By: cipolleschi

Differential Revision: D67975049

fbshipit-source-id: dace7c931ec310538c11c4b9e544fdc2241a1d0c
2025-01-10 03:44:04 -08:00
Nick Gerleman
a28867f952 Remove home-rolled yarn caching (#48237)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48237

Noticed this when trying to diagnose what seemed like a stale caching issue. It effectively reverts D59917944.

D59917944 added logic to only do yarn caching on main, but it has some correctness issues:
1. We cache `node_modules` instead of the yarn cache, which may contain e.g. build artifacts, or other scratch/cache files written (such as anything that writes to `node_modules/.cache`). We really want to be caching the yarn cache, which has pristine packages before install, which I think it will also need to perform the real install anyways.
2. We key the cache on root `package.json`, which is missing a lot of information (both provided by the other `package.json` in the repo, but mostly, the lockfile resolution).

We only save cache when we're on `refs/heads/main` (so continuous builds against main), and supposedly, builds against base branch should be able to restore against those, but recent PR jobs I have seen, where `package.json` has not changed, all have `Cache not found for input keys: node-modules-068350889e87919c1c6c2c220c8d2d92db13f38820bf2efb315d1274b97bc367`

Because of the potential correctness issues, and that the strategy for limiting to main seemingly is not allowing cache to be used in PR, this diff goes back to previous solution, which may store more artifacts (but working cache should also reduce cost by making jobs run faster).

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D67140004

fbshipit-source-id: f74074a498af56b1837fa23cf80795f76935b762
2024-12-12 09:13:52 -08:00
Nicola Corti
2ca01b4d04 Revert "Remove unnecessary git config --global --add safe.directory" (#45929)
Summary:
This reverts commit 9d9a8d2df6.

## Changelog:

[INTERNAL] - This reverts commit 9d9a8d2df6.

Pull Request resolved: https://github.com/facebook/react-native/pull/45929

Test Plan: CI

Reviewed By: blakef

Differential Revision: D60901502

Pulled By: cortinico

fbshipit-source-id: 2b7a7908a29f031c1f229907aa899a8a6960da4b
2024-08-07 06:39:31 -07:00
Riccardo Cipolleschi
24e7f7d256 Try to restore caches for Hermes (#45908)
Summary:
We had CI on main failing consistently the past couple of days.
The problem is that the hermes pipeline is failing to create the iOS XCFramework with the error:
> unable to create a Mach-O from the binary at '/Users/runner/work/react-native/react-native/packages/react-native/sdks/hermes/destroot/Library/Frameworks/catalyst/hermes.framework/hermes'

The main cause is this upgrade of [upload-artifacts](https://github.com/actions/upload-artifact/issues/590) which breaks symlinks.

The solution is to bump the caches and downgrade the `upload-artifact` actions.
## Changelog:
[Internal] - Try to fix CI for Hermes

Pull Request resolved: https://github.com/facebook/react-native/pull/45908

Test Plan: GHA must be green

Reviewed By: cortinico

Differential Revision: D60828616

Pulled By: cipolleschi

fbshipit-source-id: 6976b86dd67e2fd9d806ebaa62f47e39dc44b30d
2024-08-06 06:41:35 -07:00
Riccardo Cipolleschi
44d38c9d4d Run e2e tests only on main and on stable branches (#45706)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45706

## Context
Running manual tests when preparing a release, it's time consuming.
We have to do the cherry picks, wait for CI to finish, and then manually test 8 configurations.

Maestro is a tool that allow us to run E2E tests automatically, and we can wire it to CI.

## Change
To avoid flakyness and costs, let's run E2E tests only on main and on stable branches

Changelog:
[Internal] - Exploration to integrate maestro

Reviewed By: blakef

Differential Revision: D60283204

fbshipit-source-id: 806cb8905cb269f18785158dcc5777ef10e0ef44
2024-07-26 09:57:46 -07:00
Riccardo Cipolleschi
4adc1e3b15 Connect Android RNTester to Maestro (#45709)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45709

## Context
Running manual tests when preparing a release, it's time consuming.
We have to do the cherry picks, wait for CI to finish, and then manually test 8 configurations.

Maestro is a tool that allow us to run E2E tests automatically, and we can wire it to CI.

## Change

Connect RNTester Android to Maestro action

Changelog:
[Internal] - Exploration to integrate maestro

Reviewed By: blakef

Differential Revision: D60282769

fbshipit-source-id: 2a20f1cb249fc5c43b0579c3309efd60369a1da6
2024-07-26 09:57:46 -07:00
Nicola Corti
ac0c5fb8b5 Update ccache key to use github.ref (#45698)
Summary:
Update ccache key to use github.ref

## Changelog:

[INTERNAL] - Update ccache key to use github.ref

Pull Request resolved: https://github.com/facebook/react-native/pull/45698

Test Plan: CI

Reviewed By: blakef

Differential Revision: D60277122

Pulled By: cortinico

fbshipit-source-id: 10437e56a398e817fb030d505fbdb6cf7c23031a
2024-07-26 03:02:27 -07:00
Nicola Corti
3df2a86a24 Update ccache path (#45674)
Summary:
The correct path for ccache storage dir is actually `/github/home/.cache/ccache`

## Changelog:

[INTERNAL] - Update ccache path

Pull Request resolved: https://github.com/facebook/react-native/pull/45674

Test Plan: CI

Reviewed By: cipolleschi

Differential Revision: D60236560

Pulled By: cortinico

fbshipit-source-id: bbce9081e6647e660c3f80d61d791268de5b75d1
2024-07-25 08:43:19 -07:00
Nicola Corti
eae2240bfc Adding ccache for Android builds (#45662)
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
2024-07-25 07:33:46 -07:00
Nicola Corti
9d9a8d2df6 Remove unnecessary git config --global --add safe.directory (#45663)
Summary:
`git config --global --add safe.directory` is no longer necessary because is done inside the Docker container.

## Changelog:

[INTERNAL] - Remove unnecessary git config --global --add safe.directory

Pull Request resolved: https://github.com/facebook/react-native/pull/45663

Test Plan: CI

Reviewed By: blakef

Differential Revision: D60229662

Pulled By: cortinico

fbshipit-source-id: aa817ff27adaab3e3105ab22af74a871b377295b
2024-07-25 04:13:16 -07:00
Blake Friedman
4410899ec7 Only cache node_modules on main (#45544)
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
2024-07-19 13:04:07 -07:00
Nicola Corti
c1b4133a58 Composite actions inputs should be kebab-case (#45474)
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
2024-07-17 03:48:36 -07:00
Nicola Corti
8d0cbbf0e6 Make build_android publish to the staging repositories (#45468)
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
2024-07-16 13:58:43 -07:00
Nicola Corti
12f58a6452 Split the rntester APK artifacts in 4 (#45475)
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
2024-07-16 10:01:21 -07:00
Nicola Corti
16b9b55cf1 actions/upload-artifact to v4.x
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
2024-07-16 10:01:21 -07:00
Riccardo Cipolleschi
3d5daa12d4 Factor out build-android (#45455)
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
2024-07-16 03:34:34 -07:00