Skip to content

Commit 861c024

Browse files
andrewdacenkofacebook-github-bot
authored andcommitted
Add basic steps in CI (#52225)
Summary: Pull Request resolved: #52225 This diff prepares the RN CI to build and run Fantom Tests ## Changelog: [Internal] - Fantom in RN CLI {P1872029634} Differential Revision: D70097944
1 parent 8628398 commit 861c024

File tree

8 files changed

+97
-13
lines changed

8 files changed

+97
-13
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Run Fantom Tests
2+
inputs:
3+
release-type:
4+
required: true
5+
description: The type of release we are building. It could be nightly, release or dry-run
6+
gradle-cache-encryption-key:
7+
description: "The encryption key needed to store the Gradle Configuration cache"
8+
runs:
9+
using: composite
10+
steps:
11+
- name: Install dependencies
12+
shell: bash
13+
run: |
14+
sudo apt update
15+
sudo apt install -y git cmake openssl libssl-dev clang
16+
- name: Setup git safe folders
17+
shell: bash
18+
run: git config --global --add safe.directory '*'
19+
- name: Setup node.js
20+
uses: ./.github/actions/setup-node
21+
- name: Install node dependencies
22+
uses: ./.github/actions/yarn-install
23+
- name: Set React Native Version
24+
shell: bash
25+
run: node ./scripts/releases/set-rn-artifacts-version.js --build-type ${{ inputs.release-type }}
26+
- name: Setup gradle
27+
uses: ./.github/actions/setup-gradle
28+
with:
29+
cache-read-only: "false"
30+
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
31+
- name: Restore Android ccache
32+
uses: actions/cache/restore@v4
33+
with:
34+
path: /github/home/.cache/ccache
35+
key: v1-ccache-android-${{ github.job }}-${{ github.ref }}
36+
restore-keys: |
37+
v1-ccache-android-${{ github.job }}-
38+
v1-ccache-android-
39+
- name: Show ccache stats
40+
shell: bash
41+
run: ccache -s -v
42+
- name: Run Fantom Tests
43+
shell: bash
44+
run: yarn fantom
45+
env:
46+
CC: clang
47+
CXX: clang++
48+
- name: Upload test results
49+
if: ${{ always() }}
50+
uses: actions/[email protected]
51+
with:
52+
name: run-fantom-tests-results
53+
compression-level: 1
54+
path: |
55+
packages/react-native-gradle-plugin/react-native-gradle-plugin/build/reports
56+
packages/react-native-gradle-plugin/settings-plugin/build/reports
57+
packages/react-native/ReactAndroid/build/reports
58+
private/react-native-fantom/build/reports
59+
build/reports

.github/workflows/test-all.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,25 @@ jobs:
370370
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
371371
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
372372

373+
run_fantom_tests:
374+
runs-on: 8-core-ubuntu
375+
needs: [set_release_type]
376+
container:
377+
image: reactnativecommunity/react-native-android:latest
378+
env:
379+
TERM: "dumb"
380+
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
381+
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
382+
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
383+
steps:
384+
- name: Checkout
385+
uses: actions/checkout@v4
386+
- name: Build and Test Fantom
387+
uses: ./.github/actions/run-fantom-tests
388+
with:
389+
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
390+
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
391+
373392
build_hermesc_windows:
374393
runs-on: windows-2025
375394
needs: prepare_hermes_workspace

packages/react-native/ReactAndroid/src/main/jni/third-party/glog/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ target_include_directories(glog PRIVATE .)
2626
# include folder.
2727
target_include_directories(glog PUBLIC exported)
2828

29-
target_compile_reactnative_options(glog PRIVATE)
30-
3129
target_compile_options(glog PRIVATE
3230
-Wwrite-strings
3331
-Woverloaded-virtual
@@ -36,5 +34,5 @@ target_compile_options(glog PRIVATE
3634
-g
3735
-O2
3836
-DHAVE_PREAD=1
37+
-Wno-unused-result
3938
)
40-

packages/react-native/ReactCommon/cxxreact/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ target_link_libraries(react_cxxreact
2626
react_debug)
2727

2828
target_compile_reactnative_options(react_cxxreact PRIVATE)
29-
target_compile_options(react_cxxreact PRIVATE -Wno-unused-lambda-capture)
29+
target_compile_options(react_cxxreact PRIVATE
30+
-Wno-unused-lambda-capture
31+
-Wno-unused-command-line-argument)

packages/react-native/ReactCommon/cxxreact/TraceSection.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@
2828

2929
#endif
3030

31+
#ifndef __unused
32+
#if defined(__GNUC__) || defined(__clang__)
33+
#define __unused __attribute__((unused))
34+
#else
35+
#define __unused
36+
#endif
37+
#endif
38+
3139
namespace facebook::react {
3240

3341
/**

packages/react-native/ReactCommon/jsi/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ target_link_libraries(jsi
2222
folly_runtime
2323
glog)
2424

25-
target_compile_reactnative_options(jsi PRIVATE)
25+
#target_compile_reactnative_options(jsi PRIVATE)
2626
target_compile_options(jsi PRIVATE -O3 -Wno-unused-lambda-capture)

packages/react-native/ReactCommon/react/featureflags/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ add_library(react_featureflags OBJECT ${react_featureflags_SRC})
1313

1414
target_include_directories(react_featureflags PUBLIC ${REACT_COMMON_DIR})
1515

16-
target_link_libraries(react_featureflags folly_runtime)
16+
target_link_libraries(react_featureflags folly_runtime atomic)
1717
target_compile_reactnative_options(react_featureflags PRIVATE)
1818
target_compile_options(react_featureflags PRIVATE -Wpedantic)

private/react-native-fantom/tester/CMakeLists.txt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
cmake_minimum_required(VERSION 3.13)
77
set(CMAKE_VERBOSE_MAKEFILE on)
8+
if(UNIX AND NOT APPLE)
9+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
10+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
11+
endif()
812

913
project(fantom_tester)
1014

@@ -231,10 +235,4 @@ target_link_libraries(fantom_tester
231235
react_cxx_platform_react_utils
232236
)
233237

234-
target_compile_options(fantom_tester
235-
PRIVATE
236-
-Wall
237-
-Werror
238-
-fexceptions
239-
-frtti
240-
-std=c++20)
238+
target_compile_options(fantom_tester PRIVATE -std=c++20)

0 commit comments

Comments
 (0)