Commit Graph

8 Commits

Author SHA1 Message Date
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
Riccardo Cipolleschi
6c49572ee4 Make sure we don't run RN CI on forks (#53707)
Summary:
We had reports from the Community of the RN CI running on forks and causing high costs and bills for them
This change should make sure that the most impactful jobs only runs on the React Native CI and not on forks.

## Changelog:
[Internal] -

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

Test Plan: GHA

Reviewed By: cortinico

Differential Revision: D82107313

Pulled By: cipolleschi

fbshipit-source-id: ff7f418344975e7bb8306a6356d774c26bea3db1
2025-09-10 04:49:14 -07:00
Alex Hunt
d4bf1b7af0 Remove experimental notice from V2 API snapshot and build by default (#52301)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52301

Readying for imminent productionisation.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D77386064

fbshipit-source-id: 2769545eace4e6c09da0b2f0f34cf74b2fdcb730
2025-06-27 04:49:28 -07:00
Alex Hunt
1f27e3e2e4 Add build-types to release workflows (#50396)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50396

Integrates the `yarn build-types` script into our CI workflows.

**Notes**

- Will validate type generation in future PRs as part of the `test-all` workflow (this has been stable (i.e. successfully runs for our codebase) for the last 3 weeks).
- This is not load bearing in production code until D71969602.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D71975705

fbshipit-source-id: a234a05008b5e75976bbd5258948c37fcc1eeb76
2025-04-15 07:12:27 -07: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
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
818dd92a4a Align github/* action versions on major (#45542)
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
2024-07-19 05:49:03 -07:00
Nicola Corti
7c0c9a2b93 Cleanup the .github/workflows folder (#44857)
Summary:
Just doing some cleanup of the `.github/workflows` folder:
* apply-version-label-issue.yml hasn't been working since 0.72
* ios-tests is unnecessary as it's now covered by test-all
* nightlies-feedback.yml was experimental and last execution was ~5 months ago.

We can still recover them from the Git history if necessary.

## Changelog:

[INTERNAL] - Cleanup the .github/workflows folder

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

Test Plan: Will wait for CI result

Reviewed By: NickGerleman

Differential Revision: D58362912

Pulled By: cortinico

fbshipit-source-id: d886e4f077eebfdf906169f09f96a950a361cab7
2024-06-11 03:14:49 -07:00