Skip to content

Commit 4233164

Browse files
coadofacebook-github-bot
authored andcommitted
Add CI workflow for validating C++ API snapshot (#56042)
Summary: Adds CI workflow for validating whether the current C++ API snapshot is equivalent with the generated one. Differential Revision: D95963515
1 parent f1ac82c commit 4233164

File tree

9 files changed

+83757
-3
lines changed

9 files changed

+83757
-3
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Validate C++ API Snapshots
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
paths:
7+
- "packages/react-native/ReactCommon/**"
8+
- "packages/react-native/ReactAndroid/**"
9+
- "packages/react-native/React/**"
10+
- "packages/react-native/ReactApple/**"
11+
- "scripts/cxx-api/**"
12+
push:
13+
branches:
14+
- main
15+
- "*-stable"
16+
paths:
17+
- "packages/react-native/ReactCommon/**"
18+
- "packages/react-native/ReactAndroid/**"
19+
- "packages/react-native/React/**"
20+
- "packages/react-native/ReactApple/**"
21+
- "scripts/cxx-api/**"
22+
23+
jobs:
24+
validate_cxx_api_snapshots:
25+
runs-on: ubuntu-latest
26+
if: github.repository == 'facebook/react-native'
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v6
30+
- name: Install Doxygen
31+
shell: bash
32+
run: sudo apt-get update && sudo apt-get install -y doxygen
33+
- name: Setup node.js
34+
uses: ./.github/actions/setup-node
35+
- name: Run yarn
36+
uses: ./.github/actions/yarn-install
37+
- name: Set up Python
38+
uses: actions/setup-python@v5
39+
with:
40+
python-version: "3.12"
41+
- name: Install Python dependencies
42+
shell: bash
43+
run: pip install doxmlparser natsort pyyaml
44+
- name: Validate C++ API snapshots
45+
shell: bash
46+
run: python -m scripts.cxx-api.parser --check

packages/react-native/React/Views/ScrollView/RCTScrollableProtocol.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@
4343

4444
@end
4545

46-
__attribute__((deprecated("Use RCTCustomRefreshControlProtocol instead")))
47-
@protocol RCTCustomRefreshContolProtocol<RCTCustomRefreshControlProtocol>
48-
@end
46+
// __attribute__((deprecated("Use RCTCustomRefreshControlProtocol instead")))
47+
// @protocol RCTCustomRefreshContolProtocol<RCTCustomRefreshControlProtocol>
48+
// @end

scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api

Lines changed: 14526 additions & 0 deletions
Large diffs are not rendered by default.

scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api

Lines changed: 14353 additions & 0 deletions
Large diffs are not rendered by default.

scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api

Lines changed: 16401 additions & 0 deletions
Large diffs are not rendered by default.

scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api

Lines changed: 16231 additions & 0 deletions
Large diffs are not rendered by default.

scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api

Lines changed: 11102 additions & 0 deletions
Large diffs are not rendered by default.

scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api

Lines changed: 11093 additions & 0 deletions
Large diffs are not rendered by default.

scripts/cxx-api/parser/__main__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ def build_snapshot_for_view(
110110
verbose: bool = True,
111111
input_filter: str = None,
112112
) -> None:
113+
print(f"Generating API view: {api_view}")
114+
113115
# If there is already an output directory, delete it
114116
if os.path.exists(os.path.join(react_native_dir, "api")):
115117
if verbose:

0 commit comments

Comments
 (0)