Skip to content

Commit cb366ab

Browse files
andrewdacenkofacebook-github-bot
authored andcommitted
Fantom split (#54614)
Summary: Pull Request resolved: #54614 Differential Revision: D87543589
1 parent fcd6303 commit cb366ab

File tree

3 files changed

+126
-63
lines changed

3 files changed

+126
-63
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Build Fantom Test Runner
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+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Install dependencies
13+
shell: bash
14+
run: |
15+
sudo apt update
16+
sudo apt install -y git cmake openssl libssl-dev clang
17+
- name: Setup git safe folders
18+
shell: bash
19+
run: git config --global --add safe.directory '*'
20+
- name: Setup node.js
21+
uses: ./.github/actions/setup-node
22+
- name: Install node dependencies
23+
uses: ./.github/actions/yarn-install
24+
- name: Setup gradle
25+
uses: ./.github/actions/setup-gradle
26+
with:
27+
cache-read-only: "false"
28+
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
29+
- name: Restore Fantom ccache
30+
uses: actions/cache/restore@v4
31+
with:
32+
path: /github/home/.cache/ccache
33+
key: v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-${{ hashFiles(
34+
'packages/react-native/ReactAndroid/**/*.cpp',
35+
'packages/react-native/ReactAndroid/**/*.h',
36+
'packages/react-native/ReactAndroid/**/CMakeLists.txt',
37+
'packages/react-native/ReactCommon/**/*.cpp',
38+
'packages/react-native/ReactCommon/**/*.h',
39+
'packages/react-native/ReactCommon/**/CMakeLists.txt',
40+
'private/react-native-fantom/tester/**/*.cpp',
41+
'private/react-native-fantom/tester/**/*.h',
42+
'private/react-native-fantom/tester/**/CMakeLists.txt'
43+
) }}
44+
restore-keys: |
45+
v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-
46+
v2-ccache-fantom-${{ github.job }}-
47+
v2-ccache-fantom-
48+
- name: Show ccache stats
49+
shell: bash
50+
run: ccache -s -v
51+
- name: Build Fantom Test Runner
52+
shell: bash
53+
run: yarn workspace @react-native/fantom build
54+
env:
55+
CC: clang
56+
CXX: clang++
57+
FANTOM_FORCE_OSS_BUILD: 1
58+
- name: Save Fantom ccache
59+
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }}
60+
uses: actions/cache/save@v4
61+
with:
62+
path: /github/home/.cache/ccache
63+
key: v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-${{ hashFiles(
64+
'packages/react-native/ReactAndroid/**/*.cpp',
65+
'packages/react-native/ReactAndroid/**/*.h',
66+
'packages/react-native/ReactAndroid/**/CMakeLists.txt',
67+
'packages/react-native/ReactCommon/**/*.cpp',
68+
'packages/react-native/ReactCommon/**/*.h',
69+
'packages/react-native/ReactCommon/**/CMakeLists.txt',
70+
'private/react-native-fantom/tester/**/*.cpp',
71+
'private/react-native-fantom/tester/**/*.h',
72+
'private/react-native-fantom/tester/**/CMakeLists.txt'
73+
) }}
74+
- name: Show ccache stats
75+
shell: bash
76+
run: ccache -s -v
77+
- name: Upload Fantom Build Artifacts
78+
uses: actions/[email protected]
79+
with:
80+
name: fantom-build-artifacts
81+
path: |
82+
private/react-native-fantom/build/tester/fantom_tester
83+
compression-level: 1
84+
- name: Upload build logs
85+
if: ${{ always() }}
86+
uses: actions/[email protected]
87+
with:
88+
name: build-fantom-runner-logs
89+
compression-level: 1
90+
path: |
91+
private/react-native-fantom/build/reports

.github/actions/run-fantom-tests/action.yml

Lines changed: 3 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -9,70 +9,12 @@ inputs:
99
runs:
1010
using: composite
1111
steps:
12-
- name: Install dependencies
13-
shell: bash
14-
run: |
15-
sudo apt update
16-
sudo apt install -y git cmake openssl libssl-dev clang
17-
- name: Setup git safe folders
18-
shell: bash
19-
run: git config --global --add safe.directory '*'
20-
- name: Setup node.js
21-
uses: ./.github/actions/setup-node
22-
- name: Install node dependencies
23-
uses: ./.github/actions/yarn-install
24-
- name: Setup gradle
25-
uses: ./.github/actions/setup-gradle
26-
with:
27-
cache-read-only: "false"
28-
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
29-
- name: Restore Fantom ccache
30-
uses: actions/cache/restore@v4
31-
with:
32-
path: /github/home/.cache/ccache
33-
key: v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-${{ hashFiles(
34-
'packages/react-native/ReactAndroid/**/*.cpp',
35-
'packages/react-native/ReactAndroid/**/*.h',
36-
'packages/react-native/ReactAndroid/**/CMakeLists.txt',
37-
'packages/react-native/ReactCommon/**/*.cpp',
38-
'packages/react-native/ReactCommon/**/*.h',
39-
'packages/react-native/ReactCommon/**/CMakeLists.txt',
40-
'private/react-native-fantom/tester/**/*.cpp',
41-
'private/react-native-fantom/tester/**/*.h',
42-
'private/react-native-fantom/tester/**/CMakeLists.txt'
43-
) }}
44-
restore-keys: |
45-
v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-
46-
v2-ccache-fantom-${{ github.job }}-
47-
v2-ccache-fantom-
48-
- name: Show ccache stats
49-
shell: bash
50-
run: ccache -s -v
5112
- name: Run Fantom Tests
5213
shell: bash
53-
run: yarn fantom
14+
run: yarn jest --config private/react-native-fantom/config/jest.config.js
5415
env:
55-
CC: clang
56-
CXX: clang++
57-
- name: Save Fantom ccache
58-
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }}
59-
uses: actions/cache/save@v4
60-
with:
61-
path: /github/home/.cache/ccache
62-
key: v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-${{ hashFiles(
63-
'packages/react-native/ReactAndroid/**/*.cpp',
64-
'packages/react-native/ReactAndroid/**/*.h',
65-
'packages/react-native/ReactAndroid/**/CMakeLists.txt',
66-
'packages/react-native/ReactCommon/**/*.cpp',
67-
'packages/react-native/ReactCommon/**/*.h',
68-
'packages/react-native/ReactCommon/**/CMakeLists.txt',
69-
'private/react-native-fantom/tester/**/*.cpp',
70-
'private/react-native-fantom/tester/**/*.h',
71-
'private/react-native-fantom/tester/**/CMakeLists.txt'
72-
) }}
73-
- name: Show ccache stats
74-
shell: bash
75-
run: ccache -s -v
16+
FANTOM_FORCE_OSS_BUILD: 1
17+
NODE_OPTIONS: '--max-old-space-size=8192'
7618
- name: Upload test results
7719
if: ${{ always() }}
7820
uses: actions/[email protected]

.github/workflows/test-all.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ jobs:
282282
flavor: ${{ matrix.flavor }}
283283
working-directory: /tmp/RNTestProject
284284

285-
run_fantom_tests:
285+
prebuild_fantom_tester:
286286
runs-on: 8-core-ubuntu
287287
needs: [set_release_type]
288288
container:
@@ -295,7 +295,37 @@ jobs:
295295
steps:
296296
- name: Checkout
297297
uses: actions/checkout@v4
298-
- name: Build and Test Fantom
298+
- name: Build Fantom Test Runner
299+
uses: ./.github/actions/build-fantom-runner
300+
with:
301+
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
302+
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
303+
304+
run_fantom_tests:
305+
runs-on: 8-core-ubuntu
306+
needs: [set_release_type, prebuild_fantom_tester]
307+
container:
308+
image: reactnativecommunity/react-native-android:latest
309+
env:
310+
TERM: "dumb"
311+
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
312+
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
313+
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
314+
steps:
315+
- name: Checkout
316+
uses: actions/checkout@v4
317+
- name: Setup node.js
318+
uses: ./.github/actions/setup-node
319+
- name: Install node dependencies
320+
uses: ./.github/actions/yarn-install
321+
- name: Download Fantom Tester
322+
uses: actions/download-artifact@v4
323+
with:
324+
name: fantom-build-artifacts
325+
path: private/react-native-fantom/build/tester/fantom_tester
326+
- name: Make Fantom Tester executable
327+
run: chmod +x private/react-native-fantom/build/tester/fantom_tester
328+
- name: Run Fantom Tests
299329
uses: ./.github/actions/run-fantom-tests
300330
with:
301331
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}

0 commit comments

Comments
 (0)