Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions .github/actions/build-fantom-runner/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Build Fantom Test Runner
inputs:
release-type:
required: true
description: The type of release we are building. It could be nightly, release or dry-run
gradle-cache-encryption-key:
description: "The encryption key needed to store the Gradle Configuration cache"

runs:
using: composite
steps:
- name: Install dependencies
shell: bash
run: |
sudo apt update
sudo apt install -y git cmake openssl libssl-dev clang
- name: Setup git safe folders
shell: bash
run: git config --global --add safe.directory '*'
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install node dependencies
uses: ./.github/actions/yarn-install
- name: Setup gradle
uses: ./.github/actions/setup-gradle
with:
cache-read-only: "false"
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
- name: Restore Fantom ccache
uses: actions/cache/restore@v4
with:
path: /github/home/.cache/ccache
key: v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-${{ hashFiles(
'packages/react-native/ReactAndroid/**/*.cpp',
'packages/react-native/ReactAndroid/**/*.h',
'packages/react-native/ReactAndroid/**/CMakeLists.txt',
'packages/react-native/ReactCommon/**/*.cpp',
'packages/react-native/ReactCommon/**/*.h',
'packages/react-native/ReactCommon/**/CMakeLists.txt',
'private/react-native-fantom/tester/**/*.cpp',
'private/react-native-fantom/tester/**/*.h',
'private/react-native-fantom/tester/**/CMakeLists.txt'
) }}
restore-keys: |
v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-
v2-ccache-fantom-${{ github.job }}-
v2-ccache-fantom-
- name: Show ccache stats
shell: bash
run: ccache -s -v
- name: Build Fantom Test Runner
shell: bash
run: yarn workspace @react-native/fantom build
env:
CC: clang
CXX: clang++
FANTOM_FORCE_OSS_BUILD: 1
- name: Save Fantom ccache
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }}
uses: actions/cache/save@v4
with:
path: /github/home/.cache/ccache
key: v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-${{ hashFiles(
'packages/react-native/ReactAndroid/**/*.cpp',
'packages/react-native/ReactAndroid/**/*.h',
'packages/react-native/ReactAndroid/**/CMakeLists.txt',
'packages/react-native/ReactCommon/**/*.cpp',
'packages/react-native/ReactCommon/**/*.h',
'packages/react-native/ReactCommon/**/CMakeLists.txt',
'private/react-native-fantom/tester/**/*.cpp',
'private/react-native-fantom/tester/**/*.h',
'private/react-native-fantom/tester/**/CMakeLists.txt'
) }}
- name: Show ccache stats
shell: bash
run: ccache -s -v
- name: Upload Fantom Build Artifacts
uses: actions/[email protected]
with:
name: fantom-build-artifacts
path: |
private/react-native-fantom/build/tester/fantom_tester
compression-level: 1
- name: Upload build logs
if: ${{ always() }}
uses: actions/[email protected]
with:
name: build-fantom-runner-logs
compression-level: 1
path: |
private/react-native-fantom/build/reports
64 changes: 3 additions & 61 deletions .github/actions/run-fantom-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,70 +9,12 @@ inputs:
runs:
using: composite
steps:
- name: Install dependencies
shell: bash
run: |
sudo apt update
sudo apt install -y git cmake openssl libssl-dev clang
- name: Setup git safe folders
shell: bash
run: git config --global --add safe.directory '*'
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install node dependencies
uses: ./.github/actions/yarn-install
- name: Setup gradle
uses: ./.github/actions/setup-gradle
with:
cache-read-only: "false"
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
- name: Restore Fantom ccache
uses: actions/cache/restore@v4
with:
path: /github/home/.cache/ccache
key: v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-${{ hashFiles(
'packages/react-native/ReactAndroid/**/*.cpp',
'packages/react-native/ReactAndroid/**/*.h',
'packages/react-native/ReactAndroid/**/CMakeLists.txt',
'packages/react-native/ReactCommon/**/*.cpp',
'packages/react-native/ReactCommon/**/*.h',
'packages/react-native/ReactCommon/**/CMakeLists.txt',
'private/react-native-fantom/tester/**/*.cpp',
'private/react-native-fantom/tester/**/*.h',
'private/react-native-fantom/tester/**/CMakeLists.txt'
) }}
restore-keys: |
v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-
v2-ccache-fantom-${{ github.job }}-
v2-ccache-fantom-
- name: Show ccache stats
shell: bash
run: ccache -s -v
- name: Run Fantom Tests
shell: bash
run: yarn fantom
run: yarn jest --config private/react-native-fantom/config/jest.config.js
env:
CC: clang
CXX: clang++
- name: Save Fantom ccache
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }}
uses: actions/cache/save@v4
with:
path: /github/home/.cache/ccache
key: v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-${{ hashFiles(
'packages/react-native/ReactAndroid/**/*.cpp',
'packages/react-native/ReactAndroid/**/*.h',
'packages/react-native/ReactAndroid/**/CMakeLists.txt',
'packages/react-native/ReactCommon/**/*.cpp',
'packages/react-native/ReactCommon/**/*.h',
'packages/react-native/ReactCommon/**/CMakeLists.txt',
'private/react-native-fantom/tester/**/*.cpp',
'private/react-native-fantom/tester/**/*.h',
'private/react-native-fantom/tester/**/CMakeLists.txt'
) }}
- name: Show ccache stats
shell: bash
run: ccache -s -v
FANTOM_FORCE_OSS_BUILD: 1
NODE_OPTIONS: '--max-old-space-size=8192'
- name: Upload test results
if: ${{ always() }}
uses: actions/[email protected]
Expand Down
36 changes: 34 additions & 2 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ jobs:
flavor: ${{ matrix.flavor }}
working-directory: /tmp/RNTestProject

run_fantom_tests:
prebuild_fantom_tester:
runs-on: 8-core-ubuntu
needs: [set_release_type]
container:
Expand All @@ -295,7 +295,39 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Test Fantom
- name: Build Fantom Test Runner
uses: ./.github/actions/build-fantom-runner
with:
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}

run_fantom_tests:
runs-on: 8-core-ubuntu
needs: [set_release_type, prebuild_fantom_tester]
container:
image: reactnativecommunity/react-native-android:latest
env:
TERM: "dumb"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install node dependencies
uses: ./.github/actions/yarn-install
- name: Download Fantom Tester
uses: actions/download-artifact@v4
with:
name: fantom-build-artifacts
path: private/react-native-fantom/build/tester
- name: Make Fantom Tester executable
run: |
ls -la private/react-native-fantom/build/tester
chmod +x private/react-native-fantom/build/tester/fantom_tester
- name: Run Fantom Tests
uses: ./.github/actions/run-fantom-tests
with:
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
Expand Down
Loading