Adds support for UiMediaScope in iOS #4011
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - jb-main | |
| - integration | |
| env: | |
| # TODO: https://youtrack.jetbrains.com/issue/CMP-9497/Investgate-CfW-tests-flakiness-with-enabled-gradle-configuration-cache-on-CI | |
| # Web Tests require running additional processes: karma in node, browser; | |
| # To reduce the memory pressure, we change some defaults: | |
| GRADLE_WEB_TESTS_FLAGS: >- | |
| --no-daemon --stacktrace --no-parallel --no-configuration-cache | |
| -Dorg.gradle.jvmargs="-Xmx6g -XX:+UseParallelGC" | |
| -Porg.gradle.workers.max=1 | |
| jobs: | |
| compose-desktop-tests: | |
| runs-on: ubuntu-24.04 | |
| name: Desktop | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v5 | |
| - name: Setup Prerequisites | |
| uses: ./.github/actions/setup-prerequisites | |
| - name: Setup Window Manager | |
| run: sudo apt-get update && sudo apt-get install -y xvfb openbox x11-utils | |
| - name: Start X Server | |
| run: | | |
| sudo Xvfb :1 -screen 0 1920x1080x24 -extension RANDR +extension GLX & | |
| export DISPLAY=:1 | |
| until xdpyinfo >/dev/null 2>&1; do sleep 0.1; done | |
| openbox & | |
| until xprop -root _NET_SUPPORTING_WM_CHECK >/dev/null 2>&1; do sleep 0.1; done | |
| echo "DISPLAY=:1.0" >> $GITHUB_ENV | |
| - name: Run Desktop | |
| run: | | |
| ./gradlew testDesktop \ | |
| --no-daemon --stacktrace | |
| - name: Upload Screenshots | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: screenshot-tests | |
| path: | | |
| golden/**/*_actual.png | |
| golden/**/*_diff.png | |
| - name: Test Summary | |
| uses: test-summary/action@v2 | |
| with: | |
| paths: "out/**/build/test-results/**/TEST-*.xml" | |
| if: always() | |
| compose-ios-tests: | |
| runs-on: macos-26-xlarge | |
| name: iOS | |
| env: | |
| GRADLE_OPTS: -Xmx12g -Dorg.gradle.daemon=false | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v5 | |
| - name: Setup Prerequisites | |
| uses: ./.github/actions/setup-prerequisites | |
| - name: Setup Xcode | |
| uses: ./.github/actions/setup-xcode | |
| - name: Run iOS | |
| timeout-minutes: 15 | |
| run: | | |
| ./gradlew testIos \ | |
| --no-daemon --stacktrace | |
| - name: Test Summary | |
| uses: test-summary/action@v2 | |
| with: | |
| paths: "out/**/build/test-results/**/TEST-*.xml" | |
| if: always() | |
| compose-ios-utils-tests: | |
| runs-on: macos-26-xlarge | |
| name: iOS Utils | |
| env: | |
| GRADLE_OPTS: -Xmx12g -Dorg.gradle.daemon=false | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v5 | |
| - name: Setup Prerequisites | |
| uses: ./.github/actions/setup-prerequisites | |
| - name: Setup Xcode | |
| uses: ./.github/actions/setup-xcode | |
| - name: Run iOS Utils | |
| timeout-minutes: 15 | |
| shell: bash | |
| working-directory: compose/ui/ui-uikit/src/iosMain/objc/CMPUIKitUtils | |
| run: | | |
| xcodebuild test \ | |
| -resultBundlePath TestResults.xcresult \ | |
| -scheme CMPUIKitUtilsTests \ | |
| -project CMPUIKitUtils.xcodeproj \ | |
| -destination 'platform=iOS Simulator,name=iPhone 17,OS=26.5' | |
| - name: Upload Test Results | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: TestResults-${{ github.run_number }}.xcresult | |
| path: compose/ui/ui-uikit/src/iosMain/objc/CMPUIKitUtils/TestResults.xcresult | |
| compose-ios-instrumented-tests: | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| runtime: [ 'ios18', 'ios26' ] | |
| device_type: [ 'phone', 'tablet' ] | |
| include: | |
| # Resolve runtime-specific Xcode and runner configuration. | |
| - runtime: 'ios18' | |
| runtime_name: 'iOS 18.6' | |
| runner: macos-15-xlarge | |
| simulator_os: '18.6' | |
| xcode_path: '/Applications/Xcode_26.3.app' | |
| xcode_cache_key_suffix: '26.3' | |
| - runtime: 'ios26' | |
| runtime_name: 'iOS 26.5' | |
| runner: macos-26-xlarge | |
| simulator_os: '26.5' | |
| xcode_path: '/Applications/Xcode_26.5.app' | |
| xcode_cache_key_suffix: '26.5' | |
| # Resolve runtime/device_type combinations to concrete simulator devices. | |
| - runtime: 'ios18' | |
| device_type: 'phone' | |
| device: 'iPhone 16' | |
| - runtime: 'ios18' | |
| device_type: 'tablet' | |
| device: 'iPad Pro 11-inch (M4)' | |
| - runtime: 'ios26' | |
| device_type: 'phone' | |
| device: 'iPhone 17' | |
| - runtime: 'ios26' | |
| device_type: 'tablet' | |
| device: 'iPad Pro 11-inch (M5)' | |
| name: iOS Instrumented ${{ matrix.runtime_name }} / ${{ matrix.device }} | |
| env: | |
| GRADLE_OPTS: -Xmx12g -Dorg.gradle.daemon=false | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v5 | |
| - name: Setup iOS Instrumented Test Environment | |
| id: setup-ios-instrumented-test-environment | |
| uses: ./.github/actions/setup-ios-instrumented-test-environment | |
| with: | |
| xcode-path: ${{ matrix.xcode_path }} | |
| xcode-cache-key-suffix: ${{ matrix.xcode_cache_key_suffix }} | |
| simulator-device: ${{ matrix.device }} | |
| simulator-os: ${{ matrix.simulator_os }} | |
| - name: Run iOS Instrumented | |
| timeout-minutes: 40 | |
| shell: bash | |
| working-directory: compose/ui/ui/src/uikitInstrumentedTest/launcher | |
| env: | |
| # Keep xcodebuild's stdout unbuffered so its log lines stay in order. | |
| NSUnbufferedIO: "YES" | |
| run: | | |
| xcodebuild test \ | |
| -resultBundlePath TestResults.xcresult \ | |
| -scheme Launcher \ | |
| -project Launcher.xcodeproj \ | |
| -destination 'platform=iOS Simulator,id=${{ steps.setup-ios-instrumented-test-environment.outputs.simulator-id }}' | |
| - name: Upload Test Results | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: TestResults-${{ github.run_number }}-${{ matrix.runtime }}-${{ matrix.device_type }}.xcresult | |
| path: compose/ui/ui/src/uikitInstrumentedTest/launcher/TestResults.xcresult | |
| - name: Test Summary | |
| uses: test-summary/action@v2 | |
| with: | |
| paths: "**/reports/junit.xml" | |
| if: always() | |
| compose-web-chrome-tests: | |
| runs-on: ubuntu-24.04 | |
| name: Web Chrome | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| chrome: [ '134', 'stable' ] | |
| task: [ 'Js', 'Wasm' ] | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v5 | |
| - name: Setup Prerequisites | |
| uses: ./.github/actions/setup-prerequisites | |
| - name: Setup Google Chrome | |
| uses: browser-actions/setup-chrome@v2 | |
| id: setup-chrome | |
| with: | |
| chrome-version: ${{ matrix.chrome }} | |
| install-chromedriver: true | |
| install-dependencies: true | |
| # Compile tests as a separate step to reduce memory usage and potential OOM during running tests. | |
| # We want to compile only the tests to be run later, so we extract the test tasks from --dry-run output. | |
| - name: Compile web test executables | |
| run: | | |
| set -euo pipefail | |
| TASKS=$( | |
| ./gradlew :mpp:testWeb${{ matrix.task }} -m --console=plain --no-configuration-cache \ | |
| --no-daemon -Pkotlin.compiler.execution.strategy=in-process \ | |
| | awk '/^:.*compileTestDevelopmentExecutable/ {print $1}' \ | |
| | tr '\n' ' ' | |
| ) | |
| if [ -n "$TASKS" ]; then | |
| ./gradlew $TASKS \ | |
| --no-daemon --stacktrace --no-parallel --no-configuration-cache \ | |
| -Dorg.gradle.jvmargs="-Xmx12g -XX:+UseParallelGC" \ | |
| -Porg.gradle.workers.max=1 -Pkotlin.compiler.execution.strategy=in-process | |
| fi | |
| - name: Start X Server | |
| run: | | |
| sudo Xvfb :1 -screen 0 1920x1080x24 -extension RANDR +extension GLX & | |
| echo "DISPLAY=:1.0" >> $GITHUB_ENV | |
| - name: Memory snapshot | |
| run: | | |
| echo "=== free -h ===" | |
| free -h | |
| echo "=== meminfo ===" | |
| head -n 5 /proc/meminfo | |
| - name: Top memory consumers | |
| run: | | |
| ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head -n 15 | |
| - name: Run Web Chrome | |
| run: | | |
| set -euo pipefail | |
| (while true; do | |
| echo "=== meminfo $(date -u +%H:%M:%S) ===" | |
| head -n 5 /proc/meminfo | |
| sleep 10 | |
| done) & | |
| MEM_SAMPLER_PID=$! | |
| trap "kill ${MEM_SAMPLER_PID} || true" EXIT | |
| echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns && \ | |
| CHROME_BIN=${{ steps.setup-chrome.outputs.chrome-path }} /usr/bin/time -v ./gradlew :mpp:testWeb${{ matrix.task }} ${{ env.GRADLE_WEB_TESTS_FLAGS }} \ | |
| -Pjetbrains.androidx.web.tests.enableFirefox=false \ | |
| -Pjetbrains.androidx.web.tests.enableChrome=true | |
| - name: Post-test memory snapshot | |
| if: always() | |
| run: | | |
| echo "=== free -h ===" | |
| free -h | |
| echo "=== meminfo ===" | |
| head -n 5 /proc/meminfo | |
| - name: Post-test top memory consumers | |
| if: always() | |
| run: | | |
| ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head -n 15 | |
| - name: Test Summary | |
| uses: test-summary/action@v2 | |
| with: | |
| paths: "out/**/build/test-results/**/TEST-*.xml" | |
| if: always() | |
| compose-web-firefox-tests: | |
| runs-on: ubuntu-24.04 | |
| name: Web Firefox | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # FIXME: Even after installation of '119.0', tests still use latest one. Fix and restore. | |
| firefox: [ 'latest' ] | |
| task: [ 'Wasm' ] # excluded Js for Firefox due to high flakiness | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v5 | |
| - name: Setup Prerequisites | |
| uses: ./.github/actions/setup-prerequisites | |
| # Compile tests as a separate step to reduce memory usage and potential OOM during running tests. | |
| # We want to compile only the tests to be run later, so we extract the test tasks from --dry-run output. | |
| - name: Compile web test executables | |
| run: | | |
| set -euo pipefail | |
| TASKS=$( | |
| ./gradlew :mpp:testWeb${{ matrix.task }} -m --console=plain --no-configuration-cache \ | |
| --no-daemon -Pkotlin.compiler.execution.strategy=in-process \ | |
| | awk '/^:.*compileTestDevelopmentExecutable/ {print $1}' \ | |
| | tr '\n' ' ' | |
| ) | |
| if [ -n "$TASKS" ]; then | |
| ./gradlew $TASKS \ | |
| --no-daemon --stacktrace --no-parallel --no-configuration-cache \ | |
| -Dorg.gradle.jvmargs="-Xmx12g -XX:+UseParallelGC" \ | |
| -Porg.gradle.workers.max=1 -Pkotlin.compiler.execution.strategy=in-process | |
| fi | |
| - name: Setup Missing Packages | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install libdbus-glib-1-2 -y | |
| - name: Setup Firefox | |
| uses: browser-actions/setup-firefox@v1 | |
| with: | |
| firefox-version: ${{ matrix.firefox }} | |
| - name: Start X Server | |
| run: | | |
| sudo Xvfb :1 -screen 0 1920x1080x24 -extension RANDR +extension GLX & | |
| echo "DISPLAY=:1.0" >> $GITHUB_ENV | |
| - name: Memory snapshot | |
| run: | | |
| echo "=== free -h ===" | |
| free -h | |
| echo "=== meminfo ===" | |
| head -n 5 /proc/meminfo | |
| - name: Top memory consumers | |
| run: | | |
| ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head -n 15 | |
| - name: Run Web Firefox | |
| run: | | |
| set -euo pipefail | |
| (while true; do | |
| echo "=== meminfo $(date -u +%H:%M:%S) ===" | |
| head -n 5 /proc/meminfo | |
| sleep 10 | |
| done) & | |
| MEM_SAMPLER_PID=$! | |
| trap "kill ${MEM_SAMPLER_PID} || true" EXIT | |
| ./gradlew :mpp:testWeb${{ matrix.task }} ${{ env.GRADLE_WEB_TESTS_FLAGS }} \ | |
| -Pjetbrains.androidx.web.tests.enableFirefox=true \ | |
| -Pjetbrains.androidx.web.tests.enableChrome=false | |
| - name: Test Summary | |
| uses: test-summary/action@v2 | |
| with: | |
| paths: "out/**/build/test-results/**/TEST-*.xml" | |
| if: always() |