diff --git a/.github/workflows/codegen.yml b/.github/workflows/codegen.yml index 6fefa20df6..4fd6dce765 100644 --- a/.github/workflows/codegen.yml +++ b/.github/workflows/codegen.yml @@ -33,6 +33,8 @@ jobs: with: java-version: '17' distribution: "adopt" + - name: Gradle cache + uses: gradle/gradle-build-action@v2 - uses: actions/cache@v3 id: cache with: diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index b4f850fb76..71d5e433ea 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -22,7 +22,7 @@ jobs: access_token: ${{ github.token }} metrics: - runs-on: macos-latest + runs-on: ${{ matrix.runs-on }} strategy: # we want that the matrix keeps running, default is to cancel them if it fails. fail-fast: false @@ -31,9 +31,11 @@ jobs: platform: ["ios", "android"] include: - platform: ios + runs-on: macos-latest name: iOS appPlain: test/perf/test-app-plain.ipa - platform: android + runs-on: ubuntu-latest name: Android appPlain: test/perf/TestAppPlain/android/app/build/outputs/apk/release/app-release.apk steps: @@ -45,6 +47,8 @@ jobs: with: java-version: '17' distribution: "adopt" + - name: Gradle cache + uses: gradle/gradle-build-action@v2 - name: Install Global Dependencies run: yarn global add react-native-cli @sentry/cli yalc - uses: actions/cache@v3 @@ -141,7 +145,7 @@ jobs: react-native-build: name: Build RN ${{ matrix.rn-version }} ${{ matrix.rn-architecture }} ${{ matrix.engine }} ${{ matrix.platform }} ${{ matrix.build-type }} ${{ matrix.ios-use-frameworks }} - runs-on: macos-latest + runs-on: ${{ matrix.runs-on }} env: RN_SENTRY_POD_NAME: RNSentry RN_DIFF_REPOSITORY: https://github.com/react-native-community/rn-diff-purge.git @@ -151,16 +155,19 @@ jobs: rn-version: ['0.65.3', '0.73.2'] rn-architecture: ['legacy', 'new'] platform: ['android', 'ios'] - build-type: ['dev', 'production'] + build-type: ['production'] ios-use-frameworks: ['no', 'static', 'dynamic'] engine: ['hermes', 'jsc'] include: - platform: ios + runs-on: macos-latest runtime: 'latest' device: 'iPhone 14' + - platform: android + runs-on: ubuntu-latest exclude: # exclude JSC for new RN versions (keeping the matrix manageable) - - rn-version: '0.72.4' + - rn-version: '0.73.2' engine: 'jsc' # exclude all rn versions lower than 0.70.0 for new architecture - rn-version: '0.65.3' @@ -215,10 +222,16 @@ jobs: java-version: '17' distribution: 'adopt' + - name: Gradle cache + uses: gradle/gradle-build-action@v2 + - name: Setup Global Tools run: | yarn global add yalc semver - brew install xcbeautify + + - name: Setup Global Xcode Tools + if: ${{ matrix.platform == 'ios' }} + run: brew install xcbeautify - name: NPM cache SDK uses: actions/cache@v3 @@ -387,7 +400,7 @@ jobs: react-native-test: name: Test RN ${{ matrix.rn-version }} ${{ matrix.rn-architecture }} ${{ matrix.engine }} ${{ matrix.platform }} ${{ matrix.build-type }} ${{ matrix.ios-use-frameworks }} needs: react-native-build - runs-on: macos-latest + runs-on: ${{ matrix.runs-on }} strategy: fail-fast: false # keeps matrix running if one fails matrix: @@ -399,8 +412,11 @@ jobs: engine: ['hermes', 'jsc'] include: - platform: ios + runs-on: macos-latest runtime: 'latest' device: 'iPhone 14' + - platform: android + runs-on: ubuntu-latest exclude: # exclude all rn versions lower than 0.70.0 for new architecture - rn-version: '0.65.3' @@ -408,7 +424,7 @@ jobs: # e2e test only the default combinations - rn-version: '0.65.3' engine: 'hermes' - - rn-version: '0.72.4' + - rn-version: '0.73.2' engine: 'jsc' env: PLATFORM: ${{ matrix.platform }} @@ -416,7 +432,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Global Tools + - name: Setup Global Xcode Tools + if: ${{ matrix.platform == 'ios' }} run: brew install xcbeautify - name: Download App Package @@ -445,6 +462,21 @@ jobs: java-version: '17' distribution: 'adopt' + - name: Gradle cache + uses: gradle/gradle-build-action@v2 + + - name: Setup KVM + if: ${{ matrix.platform == 'android' }} + shell: bash + run: | + # check if virtualization is supported... + sudo apt install -y --no-install-recommends cpu-checker coreutils && echo "CPUs=$(nproc --all)" && kvm-ok + # allow access to KVM to run the emulator + 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: NPM cache E2E Tests Library uses: actions/cache@v3 id: deps-cache-e2e-library @@ -494,10 +526,15 @@ jobs: uses: reactivecircus/android-emulator-runner@50986b1464923454c95e261820bc626f38490ec0 # pin@v2 with: working-directory: test/e2e - api-level: 29 + api-level: 30 + force-avd-creation: false + disable-animations: true + disable-spellchecker: true + target: 'aosp_atd' + channel: canary # Necessary for ATDs emulator-options: > - -accel on - -no-snapshot + -no-window + -no-snapshot-save -gpu swiftshader_indirect -noaudio -no-boot-anim diff --git a/.github/workflows/native-tests.yml b/.github/workflows/native-tests.yml index 9ce34ffab3..a2136c6fa7 100644 --- a/.github/workflows/native-tests.yml +++ b/.github/workflows/native-tests.yml @@ -62,6 +62,17 @@ jobs: - name: Gradle cache uses: gradle/gradle-build-action@v2 + - name: Setup KVM + shell: bash + run: | + # check if virtualization is supported... + sudo apt install -y --no-install-recommends cpu-checker coreutils && echo "CPUs=$(nproc --all)" && kvm-ok + # allow access to KVM to run the emulator + 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@v3 id: avd-cache @@ -69,47 +80,48 @@ jobs: path: | ~/.android/avd/* ~/.android/adb* - key: avd-21 + key: avd-aosp-atd-30 - name: Create AVD and generate snapshot for caching if: steps.avd-cache.outputs.cache-hit != 'true' uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b #pin@v2.28.0 with: - api-level: 21 + api-level: 30 + force-avd-creation: false + disable-animations: true + disable-spellchecker: true + target: 'aosp_atd' + channel: canary # Necessary for ATDs emulator-options: > - -accel on -no-window + -no-snapshot-save -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -camera-front none -timezone US/Pacific - force-avd-creation: false - disable-animations: true - arch: x86_64 - profile: Nexus 6 script: echo "Generated AVD snapshot for caching." - name: Run connected tests uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b #pin@v2.28.0 with: working-directory: RNSentryAndroidTester - api-level: 21 + api-level: 30 + force-avd-creation: false + disable-animations: true + disable-spellchecker: true + target: 'aosp_atd' + channel: canary # Necessary for ATDs emulator-options: > - -no-snapshot-save - -accel on -no-window + -no-snapshot-save -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -camera-front none -timezone US/Pacific - force-avd-creation: false - disable-animations: true - arch: x86_64 - profile: Nexus 6 script: | ./gradlew uninstallDebug uninstallDebugAndroidTest ./gradlew connectedCheck diff --git a/.github/workflows/sample-application.yml b/.github/workflows/sample-application.yml index 3ebb2b2eba..b337000ed4 100644 --- a/.github/workflows/sample-application.yml +++ b/.github/workflows/sample-application.yml @@ -24,8 +24,7 @@ jobs: build: name: Build ${{ matrix.rn-architecture }} ${{ matrix.platform }} ${{ matrix.build-type }} - # Android emulator said to perform best with macos HAXM - runs-on: macos-latest + runs-on: ${{ matrix.runs-on }} strategy: # we want that the matrix keeps running, default is to cancel them if it fails. fail-fast: false @@ -35,8 +34,11 @@ jobs: build-type: ['dev', 'production'] include: - platform: ios + runs-on: macos-latest runtime: 'latest' device: 'iPhone 14' + - platform: android + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -52,7 +54,11 @@ jobs: java-version: '17' distribution: 'adopt' - - name: Install Global Dependencies + - name: Gradle cache + uses: gradle/gradle-build-action@v2 + + - name: Setup Global Xcode Tools + if: ${{ matrix.platform == 'ios' }} run: brew install xcbeautify - name: NPM cache @@ -62,7 +68,7 @@ jobs: path: | node_modules samples/react-native/node_modules - key: ${{ github.workflow }}-${{ github.job }}-npm-${{ hashFiles('yarn.lock', 'samples/react-native/yarn.lock') }} + key: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-npm-${{ hashFiles('yarn.lock', 'samples/react-native/yarn.lock') }} - name: Install SDK Dependencies if: ${{ steps.deps-cache.outputs['cache-hit'] != 'true' }}