Skip to content

Commit 134a817

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

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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
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+
- name: Upload test results
46+
if: ${{ always() }}
47+
uses: actions/[email protected]
48+
with:
49+
name: run-fantom-tests-results
50+
compression-level: 1
51+
path: |
52+
packages/react-native-gradle-plugin/react-native-gradle-plugin/build/reports
53+
packages/react-native-gradle-plugin/settings-plugin/build/reports
54+
packages/react-native/ReactAndroid/build/reports
55+
private/react-native-fantom/build/reports

.github/workflows/test-all.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,25 @@ jobs:
388388
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
389389
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
390390

391+
run_fantom_tests:
392+
runs-on: 8-core-ubuntu
393+
needs: [set_release_type]
394+
container:
395+
image: reactnativecommunity/react-native-android:latest
396+
env:
397+
TERM: "dumb"
398+
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
399+
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
400+
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
401+
steps:
402+
- name: Checkout
403+
uses: actions/checkout@v4
404+
- name: Build and Test Fantom
405+
uses: ./.github/actions/run-fantom-tests
406+
with:
407+
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
408+
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
409+
391410
build_hermesc_windows:
392411
runs-on: windows-2025
393412
needs: prepare_hermes_workspace

scripts/fantom.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# This source code is licensed under the MIT license found in the
55
# LICENSE file in the root directory of this source tree.
66

7+
set -e
8+
79
if [[ -f "BUCK" && -z "$FANTOM_FORCE_OSS_BUILD" ]]; then
810
JS_DIR='..' yarn jest --config private/react-native-fantom/config/jest.config.js "$@"
911
else

0 commit comments

Comments
 (0)