Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/actions/installMaestro/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:
- name: Install Maestro CLI
shell: bash
run: |
export MAESTRO_VERSION=1.40.3
export MAESTRO_VERSION=1.41.0
curl -Ls "https://get.maestro.mobile.dev" | bash

- name: Conditionally install brew packages for iOS
Expand Down
8 changes: 7 additions & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@ runs:
node-version: 20

- name: Install dependencies
run: yarn install --frozen-lockfile --immutable
run: yarn install --immutable
shell: bash

- name: Extract repository name from GITHUB_REPOSITORY
shell: bash
run: |
REPO_NAME="${GITHUB_REPOSITORY##*/}"
echo "GITHUB_REPOSITORY_NAME=$REPO_NAME" >> "$GITHUB_ENV"
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
cache: yarn

- name: Install Dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable

- name: Create Release Pull Request or Publish to npm
id: changesets
Expand All @@ -36,4 +36,4 @@ jobs:
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
109 changes: 75 additions & 34 deletions .github/workflows/test-e2e-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
push:
branches:
- main
- 50-e2e-stability

workflow_dispatch:

Expand All @@ -29,19 +30,48 @@ env:
MAESTRO_DISABLE_UPDATE_CHECK: true

jobs:
e2e-android:
build-release:
runs-on: ubuntu-latest
outputs:
artifact-id: ${{ steps.rnef-remote-build-android.outputs.artifact-id }}

steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup
uses: ./.github/actions/setup

- name: Run generate:legal from bare-example
run: yarn workspace react-native-legal-bare-example generate:legal
shell: bash

- name: "[WORKAROUND] run generateCodegenArtifactsFromSchema manually for example app"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this workaround done, because RNEF does not invoke codegen when building native part?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it with and without RNEF. I spent some time fighting this bug, and @artus9033 helped me with it. It started working with this script before the build. Without it, it breaks. The build. My plan was to commit it with a workaround and then try to fix this bug in a separate context.

shell: bash
run: |
cd examples/bare-example/android
./gradlew generateCodegenArtifactsFromSchema

- name: RNEF Remote Build - Android
id: rnef-remote-build-android
uses: callstackincubator/android@v1
with:
variant: release
github-token: ${{ secrets.GITHUB_TOKEN }}
sign: false
comment-bot: false
working-directory: ./examples/bare-example

run-e2e-tests:
runs-on: ubuntu-latest
needs: build-release
strategy:
fail-fast: false
matrix:
api-level: [30, 34, 35]
api-level: [ 30, 33, 35 ]
steps:
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- name: Checkout Repo
uses: actions/checkout@v4
with:
Expand All @@ -50,49 +80,60 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Download artifact
run: |
cd examples/bare-example
npx rnef remote-cache list-all
npx rnef remote-cache download --name "${{ needs.build-release.outputs.artifact-id }}"

- name: Install Maestro
uses: ./.github/actions/installMaestro
with:
target-platform: android

- name: Cache Build
id: cache-build
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- name: AVD cache
uses: actions/cache@v4
env:
cache-name: cached-android-build
id: avd-cache
with:
path: |
examples/bare-example/android/build
examples/bare-example/android/app/build
examples/bare-example/android/app/.cxx
key: bare-example-android-build
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}

- uses: actions/setup-java@v4
- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3

- name: Install example dependencies
run: yarn workspace react-native-legal-bare-example install --frozen-lockfile --immutable

- name: Bundle app
run: yarn workspace react-native-legal-bare-example build:android
api-level: ${{ matrix.api-level }}
arch: 'x86_64'
target: 'google_apis'
force-avd-creation: false
cores: 4
emulator-options: -verbose -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-front none -camera-back none
disable-animations: false
ram-size: '6144M'
script: echo "Generated AVD snapshot for caching."

- name: Create AVD and generate snapshot for caching
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: 'x86_64'
target: 'google_apis'
force-avd-creation: true
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
force-avd-creation: false
cores: 4
emulator-options: -verbose -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-front none -camera-back none
disable-animations: false
ram-size: '4096M'
script: ./scripts/e2e_android_emulator_build_and_test.sh
ram-size: '6144M'
script: |
adb install -r "$ARTIFACT_PATH_FOR_E2E"
yarn workspace react-native-legal-bare-example e2e:android

- name: Upload report
if: always()
Expand Down
74 changes: 43 additions & 31 deletions .github/workflows/test-e2e-ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,44 @@ concurrency:
cancel-in-progress: true

jobs:
e2e-ios:
build-release:
runs-on: macos-15
outputs:
artifact-id: ${{ steps.rnef-remote-build-ios.outputs.artifact-id }}
artifact-url: ${{ steps.rnef-remote-build-ios.outputs.artifact-url }}

steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup
uses: ./.github/actions/setup

- name: Run generate:legal from bare-example
run: yarn workspace react-native-legal-bare-example generate:legal
shell: bash

- name: Build iOS
id: rnef-remote-build-ios
uses: callstackincubator/ios@v1
with:
destination: 'simulator'
scheme: 'ReactNativeLegalBareExample'
configuration: 'Release'
github-token: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./examples/bare-example
comment-bot: false

run-e2e-tests:
runs-on: macos-15
needs: build-release
strategy:
fail-fast: false
matrix:
simulator: ['iPhone 16 Pro (18.5)', 'iPhone SE (3rd generation) (18.0)']
simulator: ['iPhone 16 Pro', 'iPhone SE (3rd generation)']

steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -44,43 +76,23 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Download artifact
run: |
cd examples/bare-example
npx rnef remote-cache download --name "${{ needs.build-release.outputs.artifact-id }}"

- name: Install Maestro
uses: ./.github/actions/installMaestro
with:
target-platform: ios

- name: Install example dependencies
run: yarn workspace react-native-legal-bare-example install --frozen-lockfile --immutable

- name: Cache Pods
id: cache-pods
uses: actions/cache@v4
env:
cache-name: cached-ios-pods-deps
with:
path: examples/bare-example/ios/Pods
key: bare-example-pods

- name: Cache Build
id: cache-build
uses: actions/cache@v4
env:
cache-name: cached-ios-build
with:
path: examples/bare-example/ios/build
key: bare-example-ios-build

- name: Install example Pods
run: yarn workspace react-native-legal-bare-example pods

- name: Bundle app
run: yarn workspace react-native-legal-bare-example build:ios

- name: List simulators
run: xcrun simctl list

- name: Build iOS App
run: yarn workspace react-native-legal-bare-example ios:release --simulator="${{ matrix.simulator }}"
- name: Install on simulator
run: |
cd examples/bare-example
npx rnef run:ios --binary-path "$ARTIFACT_PATH_FOR_E2E" --device "${{ matrix.simulator }}" --local

- name: Run tests
run: yarn workspace react-native-legal-bare-example e2e:ios
Expand Down
7 changes: 7 additions & 0 deletions examples/bare-example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ local.properties
.cxx/
*.keystore
!debug.keystore
.kotlin/
android/config/
ios/Settings.bundle/
ios/license_plist.yml
.rnef/
.env
.env.local

# node.js
#
Expand Down
6 changes: 6 additions & 0 deletions examples/bare-example/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'concurrent-ruby', '< 1.3.4'

# Ruby 3.4.0 has removed some libraries from the standard library.
gem 'bigdecimal'
gem 'logger'
gem 'benchmark'
gem 'mutex_m'
Loading