react-native-macos/scripts/circleci
Riccardo Cipolleschi 641be98b1e Split Config.yml to run jobs selectively (#39042)
Summary:
Right now, every PR runs the whole test suite. For example, a changelog PR, will run all the tests. As of last month, that meant quite a few $s per single run.

With this PR, we are going to leverage dynamic configuration and file filtering to create a config.yml on the flight, depending on the files changed by the commit/pr.

They way it works is the following:
- It starts a setup workflow in CircleCI.
- This workflow fetch the list of files that have been changed in the current commit.
- It executes a bunch of filtering and computation to understand which tests makes sense to run.
- It creates a config on the flight to run those.
- It continue the pipeline on that config.

Currently, the way it works is the following:
- If a `.md` file has been modified => run nothing
- If only files in the `ReactAndroid` folder are modified => run tests for android only
- If only files in the `React` folder are modified or `ruby` files are modified => run only iOS tests
- If only js files, not in the scripts folder are modified => run only JS tests
- if only files in the e2e folder are modified => run only e2e tests
- else => run everything.

Of course, we can play and modify those filters t make sure that they reflect the work and the tests to the best we can.

bypass-github-exports-checks

## Changelog:
[Internal] - Split circleci config and run test selectively.

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

Test Plan:
- [X] Tested on the local branch for general sanity check.
- [X] Import it in fbsource
- [x] Create a stacked diff which changes only a md file => verify that no tests are run.
- [x] Create a stacked diff which changes only files in ReactAndroid => verify that only android tests run.
- [x] Create a stacked diff which changes only files in React => verify that only iOS tests run.
- [x] Create a stacked diff which changes only ruby files => verify that only iOS tests run.
- [x] Create a stacked diff which changes ruby files and file in React => verify that only iOS tests run.
- [x] Create a stacked diff which changes only files JS not in the script folder => verify that JS tests run.
- [x] Create a stacked diff which changes only JS files in the script folder => verify that the whole suite starts.
- [x] Create a stacked diff which changes only files in the E2E folder => verify that only E2E files runs.
- [x] Trigger a nightly pipeline => verify that parameters are passed to the generated config.

Reviewed By: NickGerleman

Differential Revision: D48394437

Pulled By: cipolleschi

fbshipit-source-id: 771f3e68daa8318d2b73dd91ce85a41488110c04
2023-08-18 07:22:22 -07:00
..
analyze_code.sh Fix missing renames from bots to react-native-bots (#34713) 2022-09-16 12:41:06 -07:00
analyze_scripts.sh Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00
apt-get-android-deps.sh Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00
check_appium_server_status.sh Move script checking Appium server status to separate file (#38692) 2023-07-31 21:36:49 -07:00
check_license.sh Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00
exec_swallow_error.sh Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00
pipeline_selection.js Split Config.yml to run jobs selectively (#39042) 2023-08-18 07:22:22 -07:00
poll-maven.js Add script poll Maven for Artifacts (#38985) 2023-08-15 03:26:58 -07:00
report-bundle-size.sh Fix missing renames from bots to react-native-bots (#34713) 2022-09-16 12:41:06 -07:00
retry.js Add retry mechanism to test_e2e_android to reduce flakyness (#39068) 2023-08-18 04:08:56 -07:00
run_with_retry.js Implement retry mechanism during yarn installation (#39020) 2023-08-16 08:31:44 -07:00
validate_yarn_lockfile.sh Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00