buildSrc restoration in integration #665
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: Compose Tests | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - jb-main | |
| jobs: | |
| compose-desktop-tests: | |
| runs-on: ubuntu-24.04 | |
| name: Compose Desktop Tests | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v5 | |
| - name: Setup Prerequisites | |
| uses: ./.github/actions/setup-prerequisites | |
| - name: Start X Server | |
| run: | | |
| sudo Xvfb :1 -screen 0 1920x1080x24 -extension RANDR +extension GLX & | |
| echo "DISPLAY=:1.0" >> $GITHUB_ENV | |
| - name: Run Desktop Tests | |
| 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-15-xlarge | |
| name: Compose iOS Tests | |
| 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 Tests | |
| 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-15-xlarge | |
| name: Compose iOS Utils Tests | |
| 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 Tests | |
| timeout-minutes: 15 | |
| shell: bash | |
| working-directory: compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils | |
| run: | | |
| xcodebuild test \ | |
| -resultBundlePath TestResults.xcresult \ | |
| -scheme CMPUIKitUtilsTests \ | |
| -project CMPUIKitUtils.xcodeproj \ | |
| -destination 'platform=iOS Simulator,name=iPhone 16' | |
| - name: Upload Test Results | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: TestResults-${{ github.run_number }}.xcresult | |
| path: compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils/TestResults.xcresult | |
| compose-ios-instrumented-tests: | |
| runs-on: macos-15-xlarge | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| device: [ 'iPhone 16', 'iPad Pro 11-inch (M4)' ] | |
| name: Compose iOS Instrumented Tests ${{ matrix.device }} | |
| 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: Get iOS Simulator UDID | |
| id: get-simulator-udid | |
| shell: bash | |
| run: | | |
| DEVICE_NAME="${{ matrix.device }}" | |
| DEVICE_VERSION="18.6" | |
| DEVICE_DASH="${DEVICE_VERSION//./-}" # 16.0 -> 16-0 | |
| echo "Looking for device: '$DEVICE_NAME' ($DEVICE_VERSION)" | |
| SIMULATOR_ID=$(xcrun simctl list devices available -j \ | |
| | jq -r --arg device "$DEVICE_NAME" --arg vdot "$DEVICE_VERSION" --arg vdash "$DEVICE_DASH" ' | |
| .devices | |
| | to_entries[] | |
| | select(.key | (contains($vdot) or contains($vdash))) | |
| | .value[] | |
| | select(.name == $device) | |
| | .udid | |
| ' | head -n 1) | |
| if [ -z "$SIMULATOR_ID" ]; then | |
| echo "Simulator not found for $DEVICE_NAME ($DEVICE_VERSION)" | |
| echo "Available runtimes and matching devices:" | |
| xcrun simctl list devices available -j | jq -r ' | |
| .devices | to_entries[] | "\(.key):\n " + ( [.value[] | "\(.name) \(.udid) \(.state)"] | join("\n ") ) | |
| ' | |
| exit 1 | |
| fi | |
| echo "Found simulator ID: $SIMULATOR_ID" | |
| # make available to later steps | |
| echo "simulator-id=$SIMULATOR_ID" >> "$GITHUB_OUTPUT" | |
| - name: Configure Simulator | |
| run: | | |
| xcrun simctl boot "${{ steps.get-simulator-udid.outputs.simulator-id }}" | |
| # Write the accessibility flags inside the Simulator: | |
| xcrun simctl spawn booted defaults write com.apple.Accessibility AccessibilityEnabled -bool true | |
| xcrun simctl spawn booted defaults write com.apple.Accessibility ApplicationAccessibilityEnabled -bool true | |
| xcrun simctl spawn booted defaults write com.apple.Accessibility AutomationEnabled -bool true | |
| # Restart SpringBoard (so system services pick up the change) | |
| xcrun simctl spawn booted launchctl stop com.apple.SpringBoard | |
| xcrun simctl shutdown all | |
| - name: Run iOS Instrumented Tests | |
| timeout-minutes: 30 | |
| shell: bash | |
| working-directory: compose/ui/ui/src/uikitInstrumentedTest/launcher | |
| run: | | |
| xcodebuild test \ | |
| -scheme Launcher \ | |
| -project Launcher.xcodeproj \ | |
| -destination 'platform=iOS Simulator,id=${{ steps.get-simulator-udid.outputs.simulator-id }}' | |
| - 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: Compose Web Chrome Tests | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| chrome: [ '118', 'stable' ] | |
| task: [ 'Js', 'Wasm' ] | |
| 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. | |
| - name: Compile ${{ matrix.task }} Tests | |
| run: | | |
| ./gradlew compileTestKotlin${{ matrix.task }} \ | |
| --no-daemon --stacktrace | |
| - name: Setup Google Chrome | |
| uses: browser-actions/setup-chrome@v2 | |
| with: | |
| chrome-version: ${{ matrix.chrome }} | |
| install-chromedriver: true | |
| install-dependencies: true | |
| - name: Start X Server | |
| run: | | |
| sudo Xvfb :1 -screen 0 1920x1080x24 -extension RANDR +extension GLX & | |
| echo "DISPLAY=:1.0" >> $GITHUB_ENV | |
| - name: Run Web Chrome Tests | |
| run: | | |
| ./gradlew :mpp:testWeb${{ matrix.task }} \ | |
| --no-daemon --stacktrace --no-parallel \ | |
| -Pjetbrains.androidx.web.tests.enableFirefox=false \ | |
| -Pjetbrains.androidx.web.tests.enableChrome=true | |
| - 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: Compose Web Firefox Tests | |
| 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. | |
| - name: Compile ${{ matrix.task }} Tests | |
| run: | | |
| ./gradlew compileTestKotlin${{ matrix.task }} \ | |
| --no-daemon --stacktrace | |
| - 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: Run Web Firefox Tests | |
| run: | | |
| ./gradlew :mpp:testWeb${{ matrix.task }} \ | |
| --no-daemon --stacktrace --no-parallel \ | |
| -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() |