From 823520b5872686d5b10abc203956df8f9af48ec4 Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 18 Sep 2025 09:42:49 +0200 Subject: [PATCH 01/30] Remove AOSP setup --- .github/ISSUE_TEMPLATE/config.yml | 41 ---- .github/OWNERS | 3 - .../actions/build-single-project/action.yml | 74 -------- .github/ci-control/README.md | 13 -- .github/ci-control/ci-config.json | 21 --- .github/ci-control/should_run_project.py | 65 ------- .github/workflows/integration_tests.yml | 53 ------ .github/workflows/jbpresubmit.yml | 175 ------------------ .github/workflows/presubmit.yml | 168 ----------------- .github/workflows/prune_artifacts.yml | 13 -- .github/workflows/register_workflow_start.yml | 16 -- .github/workflows/scorecards.yml | 51 ----- .github/workflows/update_prebuilts.yml | 46 ----- 13 files changed, 739 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 .github/OWNERS delete mode 100644 .github/actions/build-single-project/action.yml delete mode 100644 .github/ci-control/README.md delete mode 100644 .github/ci-control/ci-config.json delete mode 100755 .github/ci-control/should_run_project.py delete mode 100644 .github/workflows/integration_tests.yml delete mode 100644 .github/workflows/jbpresubmit.yml delete mode 100644 .github/workflows/presubmit.yml delete mode 100644 .github/workflows/prune_artifacts.yml delete mode 100644 .github/workflows/register_workflow_start.yml delete mode 100644 .github/workflows/scorecards.yml delete mode 100644 .github/workflows/update_prebuilts.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 3f2be9033a6d6..0000000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,41 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Activity - url: https://issuetracker.google.com/issues/new?component=527362&template=1189829 - about: File a bug or feature request for Activity - - name: AppCompat - url: https://issuetracker.google.com/issues/new?component=460343&template=1422420 - about: File a bug or feature request for AppCompat - - name: Biometric - url: https://issuetracker.google.com/issues/new?component=559537&template=1214425 - about: File a bug or feature request for Biometric - - name: Collection - url: https://issuetracker.google.com/issues/new?component=460756&template=1422573 - about: File a bug or feature request for Collection - - name: Compose Compiler - url: https://issuetracker.google.com/issues/new?component=610764&template=1424126 - about: File a bug or feature request for Compose Compiler - - name: Core - url: https://issuetracker.google.com/issues/new?component=460834&template=1418393 - about: File a bug or feature request for Core - - name: DataStore - url: https://issuetracker.google.com/issues/new?component=907884&template=1466542 - about: File a bug or feature request for DataStore - - name: Fragment - url: https://issuetracker.google.com/issues/new?component=460964&template=1182267 - about: File a bug or feature request for Fragment - - name: Lifecycle - url: https://issuetracker.google.com/issues/new?component=413132&template=1096619 - about: File a bug or feature request for Lifecycle - - name: Navigation - url: https://issuetracker.google.com/issues/new?component=409828&template=1093757 - about: File a bug or feature request for Navigation - - name: Paging - url: https://issuetracker.google.com/issues/new?component=413106&template=1096385 - about: File a bug or feature request for Paging - - name: Room - url: https://issuetracker.google.com/issues/new?component=413107&template=1096568 - about: File a bug or feature request for Room - - name: WorkManager - url: https://issuetracker.google.com/issues/new?component=409906&template=1094197 - about: File a bug or feature request for WorkManager diff --git a/.github/OWNERS b/.github/OWNERS deleted file mode 100644 index 84acf32a685a1..0000000000000 --- a/.github/OWNERS +++ /dev/null @@ -1,3 +0,0 @@ -dustinlam@google.com -rahulrav@google.com -yboyar@google.com \ No newline at end of file diff --git a/.github/actions/build-single-project/action.yml b/.github/actions/build-single-project/action.yml deleted file mode 100644 index 19a8cb4128bec..0000000000000 --- a/.github/actions/build-single-project/action.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: 'build-single-playground-project' -description: 'Builds one playground project based on inputs' -inputs: - project: - description: "Name of the project (used for artifacts)" - required: true - project-root: - description: "Root folder of the project (used for building)" - required: true - gradle-cache-password: - description: "password for gradle cache" - gradle-enterprise-access-key: - description: "access key for gradle enterprise" - gradle-flags: - description: "flags to pass while invoking gradle" -runs: - using: "composite" - steps: - - name: "Setup JDK 8 for tools.jar" - id: setup-java8 - uses: actions/setup-java@v1 - with: - java-version: "8" - - name: "set tools jar path" - id: setup-tools-jar - shell: bash - run: | - set -x - TOOLS_JAR=$JAVA_HOME/lib/tools.jar - echo "::set-output name=toolsJar::$TOOLS_JAR" - - name: "Setup JDK 17" - id: setup-java - uses: actions/setup-java@v1 - with: - java-version: "17" - # TODO b/216535050: Implement task to install the exact AndroidX ndk - # version in case it is not available. - - name: "Install Cmake" - shell: bash - run: echo "yes" | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --install "cmake;3.22.1" - - name: "Install Android SDK Build-Tools" - shell: bash - run: echo "yes" | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --install "build-tools;34.0.0-rc3" - - name: "Set environment variables" - shell: bash - run: | - set -x - echo "DIST_DIR=$HOME/dist" >> $GITHUB_ENV - - - name: "Setup Gradle" - uses: gradle/gradle-build-action@v2 - with: - # Only save Gradle User Home state for builds on the 'androidx-main' branch. - # Builds on other branches will only read existing entries from the cache. - cache-read-only: ${{ github.ref != 'refs/heads/androidx-main' }} - - # Don't reuse cache entries from any other Job. - gradle-home-cache-strict-match: true - - # Limit the size of the cache entry. - # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. - gradle-home-cache-excludes: | - caches/jars-9 - caches/transforms-3 - - - name: "gradle buildOnServer zipTestConfigsWithApks test" - env: - JAVA_HOME: ${{ steps.setup-java.outputs.path }} - JAVA_TOOLS_JAR: ${{ steps.setup-tools-jar.outputs.toolsJar }} - GRADLE_BUILD_CACHE_PASSWORD: ${{ inputs.gradle-cache-password }} - GRADLE_ENTERPRISE_ACCESS_KEY: ${{ inputs.gradle-enterprise-access-key }} - working-directory: ${{ inputs.project-root }} - shell: bash - run: ./gradlew buildOnServer zipTestConfigsWithApks test ${{ inputs.gradle-flags }} diff --git a/.github/ci-control/README.md b/.github/ci-control/README.md deleted file mode 100644 index a4b461e30813f..0000000000000 --- a/.github/ci-control/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# AndroidX CI Control -This folder includes script(s) and configuration files to control the behavior of the GitHub CI. - -[ci-config.json](ci-config.json) file has configurations for each branch group about which projects they -should build. Each configuration group can have `exclude` and `include` filters that will filter -the projects by name from the build matrix in [presubmit.yml](../workflows/presubmit.yml). - -This configuration file is read by the [should_run_project](should_run_project.py) to let the build -know whether it should execute or skip a project. - -## Disabling a project -If you need to temporarily disable a project in CI (e.g. it needs new prebuilts), you can update the -[ci-config.json](ci-config.json) and add an `exclude` filter for the relevant branch. \ No newline at end of file diff --git a/.github/ci-control/ci-config.json b/.github/ci-control/ci-config.json deleted file mode 100644 index dfb2af63ac2ce..0000000000000 --- a/.github/ci-control/ci-config.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "__comment": [ - "Compose and Main are two configurations we have in CI.", - "Each can have include and exclude filters where these filters run an", - "exact match on the project name.", - "If the project matches both exclude and include filters, exclude is prioritized." - ], - "compose" : { - "include" : [ - "compose-runtime" - ], - "default": false - }, - "main" : { - "exclude" : [ - "compose-runtime", - "room" - ], - "default": true - } -} diff --git a/.github/ci-control/should_run_project.py b/.github/ci-control/should_run_project.py deleted file mode 100755 index 2a8b507b615b7..0000000000000 --- a/.github/ci-control/should_run_project.py +++ /dev/null @@ -1,65 +0,0 @@ -#! /usr/bin/env python3 -import sys -import getopt -import json -import os - - -def usage(exitCode): - print(""" - Usage: - ./should_run_project.py --project --branch \n\ - project-name: the name of the project from the workflow file\n\ - branch: the target branch on the build\n\ - Branches whose name starts with 'compose' use the compose configuration whereas\n\ - everything else uses the main configuration\n\ - See ci-config.json for the configuration. - """) - sys.exit(exitCode) - -# finds the configuration we should use based on the branch - - -def getCurrentConfig(branch: str): - configFilePath = os.path.join(os.path.dirname( - os.path.realpath(__file__)), "ci-config.json") - configFile = open(configFilePath) - ciConfig = json.load(configFile) - configFile.close() - if "compose-compiler" in branch: - return ciConfig["compose"] - else: - return ciConfig["main"] - - -def main(argv): - projectName = '' - branch = '' - try: - opts, args = getopt.getopt(argv, "h", ["project=", "branch="]) - except getopt.GetoptError as err: - print(err) - usage(2) - for opt, arg in opts: - if opt == '-h': - usage(0) - elif opt in ("--project"): - projectName = arg - elif opt in ("--branch"): - branch = arg - else: - print("invalid argument ", opt, "-", arg) - usage(2) - - currentConfig = getCurrentConfig(branch) - result = currentConfig["default"] - if "include" in currentConfig: - result = projectName in currentConfig["include"] - # run exclude after include to give it priority - if "exclude" in currentConfig: - result = not (projectName in currentConfig["exclude"]) - print(str(result).lower()) - - -if __name__ == "__main__": - main(sys.argv[1:]) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml deleted file mode 100644 index 1e21d7b4564eb..0000000000000 --- a/.github/workflows/integration_tests.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Run Integration Tests -on: - workflow_dispatch: - -jobs: - run_integration_tests: - runs-on: ubuntu-latest - if: ${{ !github.event.repository.fork && github.event.workflow_run.conclusion == 'success' }} - name: Run integration tests on FTL - steps: - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'zulu' - - name: "set output directory" - run: echo "::set-output name=output-dir::$(readlink -f .)/outputs" - id: dirs - - id: run_tests - uses: androidX/androidx-ci-action@dist-latest - with: - target-run-id: ${{ github.event.workflow_run.id }} - gcp-token: ${{ secrets.GCP_SA_KEY }} - github-token: ${{ secrets.GITHUB_TOKEN }} - output-folder: ${{ steps.dirs.outputs.output-dir }} - - uses: actions/upload-artifact@v2 - if: always() - with: - name: outputs - path: ${{ steps.dirs.outputs.output-dir }} - teardown: - runs-on: ubuntu-latest - needs: [run_integration_tests] - if: ${{ !github.event.repository.fork && always() }} # always() is required so that this job will run irrespective of status of upstream 'run_integration_test' job. - steps: - - name: Parse workflow status - id: workflow-status - run: | - set -x - if [ "${{ needs.run_integration_tests.result }}" == "success" ] && \ - [ "${{ github.event.workflow_run.conclusion }}" == "success" ] - then - echo "::set-output name=result::true" - else - echo "::set-output name=result::false" - fi - - - name: Result WebHook - uses: androidx/github-workflow-webhook-action@main - with: - url: 'https://androidx.dev/github/androidX/presubmit/hook' - secret: ${{ secrets.ANDROIDX_PRESUBMIT_HOOK_SECRET }} - payload: '{ "platform": "all", "token": "${{ secrets.GITHUB_TOKEN }}", "state": "completed", "success": ${{ steps.workflow-status.outputs.result }}, "src" : "workflow_run" }' diff --git a/.github/workflows/jbpresubmit.yml b/.github/workflows/jbpresubmit.yml deleted file mode 100644 index add516d9cd2ed..0000000000000 --- a/.github/workflows/jbpresubmit.yml +++ /dev/null @@ -1,175 +0,0 @@ -# This workflow is intended to be used by JB-compose team in https://github.com/JetBrains/androidx -# which is a fork of androidx repo. -# By having this file in the AndroidX upstream we (JB-compose team) avoid the need to -# rebase/cherry-pick the workflow file for every CL we want to submit upstream. - -# The aim of this workflow is to run checks and some tests before submitting the CL upstream. -name: JB-COMPOSE-variant of AndroidX Presubmits -on: - workflow_dispatch: - -jobs: - setup: - runs-on: ubuntu-latest - outputs: - gradlew_flags: ${{ steps.global-constants.outputs.gradlew_flags }} - checkout_ref: ${{ steps.checkout-args.outputs.ref }} - checkout_repo: ${{ steps.checkout-args.outputs.repository }} - steps: - - name: "Setup global constants" - id: global-constants - run: | - set -x - GRADLEW_FLAGS="-Dorg.gradle.internal.http.connectionTimeout=60000 \ - -Dorg.gradle.internal.http.socketTimeout=60000 \ - -Dorg.gradle.internal.repository.max.retries=20 \ - -Dorg.gradle.internal.repository.initial.backoff=500 \ - -Dorg.gradle.jvmargs=-XX:MaxMetaspaceSize=512m \ - --stacktrace" - echo "::set-output name=gradlew_flags::$GRADLEW_FLAGS" - - name: "Compute actions/checkout arguments" - id: checkout-args - env: - REF: ${{ github.event.pull_request.head.ref || github.event.ref}} - run: | - set -x - echo "::set-output name=ref::$REF" - - REPOSITORY=${{ github.event.pull_request.head.repo.full_name }} - if [ -z "$REPOSITORY" ]; then - REPOSITORY=${{ github.repository }} - fi - echo "::set-output name=repository::$REPOSITORY" - - lint: - runs-on: ubuntu-latest - needs: [setup] - outputs: - status: ${{ steps.output-status.outputs.status }} - affectedFileArgs: ${{ steps.affected-file-args.outputs.files }} - java: ${{ steps.setup-java.outputs.path }} - steps: - - name: Pull request format - if: ${{ false }} # - uses: 'androidx/check-pr-format-action@main' - with: - # Enforces a `Test: ` in the pull request - checks: '["(.*)?Test:(.*)?"]' - - - name: "Setup JDK 11" - id: setup-java - uses: actions/setup-java@v1 - with: - java-version: "11" - - - name: "Set environment variables" - shell: bash - run: | - set -x - echo "ANDROID_SDK_ROOT=$HOME/Library/Android/sdk" >> $GITHUB_ENV - echo "DIST_DIR=$HOME/dist" >> $GITHUB_ENV - - - name: "Checkout androidx repo" - uses: actions/checkout@v2 - with: - ref: ${{ needs.setup.outputs.checkout_ref }} - repository: ${{ needs.setup.outputs.checkout_repo }} - fetch-depth: 1 - - - name: "Get changed files in push or pull_request" - id: changed-files - uses: androidx/changed-files-action@main - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - - - name: "Warn on missing updateApi" - env: - ENABLE_UPDATEAPI_WARNING: ${{ true }} - run: | - set -x - ./development/apilint.py -f ${{ steps.changed-files.outputs.files }} - - - name: "Parse changed-files as ktlint args" - id: ktlint-file-args - run: | - set -x - KTLINT_FILES=`echo "${{ steps.changed-files.outputs.files }}" | sed 's|[^ ]* *|--file=../&|g' | grep -v "*.txt"` - echo "::set-output name=ktlint-file-args::$KTLINT_FILES" - - - name: "Parse changed-files as affected files args" - id: affected-file-args - run: | - set -x - AFFECTED_FILES=`echo "${{ steps.changed-files.outputs.files_including_removals }}" | sed 's|\([^ ]\+\)|--changedFilePath=\1|g'` - echo "::set-output name=files::$AFFECTED_FILES" - - name: "warm up gradle" - id: warm-up-gradle-cache - uses: gradle/gradle-command-action@v1 - env: - JAVA_HOME: ${{ steps.setup-java.outputs.path }} - JAVA_TOOLS_JAR: ${{ steps.setup-tools-jar.outputs.toolsJar }} - with: - arguments: tasks -PandroidXUnusedParameter=compose-jb # add project name to cache key - build-root-directory: activity - configuration-cache-enabled: true - dependencies-cache-enabled: true - dependencies-cache-key: | - **/libs.versions.toml - dependencies-cache-exact: false - gradle-executable: activity/gradlew - wrapper-directory: activity/gradle/wrapper - distributions-cache-enabled: true - - name: "ktlint" - uses: gradle/gradle-command-action@v1 - env: - JAVA_HOME: ${{ steps.setup-java.outputs.path }} - with: - arguments: -q :ktlintCheckFile ${{ steps.ktlint-file-args.outputs.ktlint-file-args }} ${{ needs.setup.outputs.gradlew_flags }} - build-root-directory: activity - configuration-cache-enabled: false - dependencies-cache-enabled: false - gradle-executable: activity/gradlew - wrapper-directory: activity/gradle/wrapper - distributions-cache-enabled: false - - tests: - runs-on: ubuntu-latest - needs: [ setup, lint ] - steps: - - name: "Setup JDK 11" - id: setup-java - uses: actions/setup-java@v1 - with: - java-version: "11" - - - name: "checkout dependencies" - shell: bash - # checkout compose-jb repo containing scripts for running tests. - # note: this step also downloads Android sdk because we don't do full `repo sync` but - # install/checkout only what's needed for testing scripts. - run: | - if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then - GITHUB_SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha) - fi - git clone -n https://github.com/JetBrains/compose-jb - cd compose-jb - git checkout origin/mpp - git submodule update --init --recursive - - pushd compose/frameworks/support - git fetch - git checkout $GITHUB_SHA - git log -1 --oneline - popd - - ./compose/scripts/downloadAndroidSdk - - - name: "run tests" - shell: bash - env: - JAVA_HOME: ${{ steps.setup-java.outputs.path }} - run: | - cd compose-jb - unset ANDROID_SDK_HOME - export ANDROID_HOME=$PWD/compose/prebuilts/fullsdk-linux - ./compose/scripts/testComposeModules diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml deleted file mode 100644 index f1faa6bda81ec..0000000000000 --- a/.github/workflows/presubmit.yml +++ /dev/null @@ -1,168 +0,0 @@ -name: AndroidX Presubmits -on: - workflow_dispatch: - -env: - # Allow precise monitoring of the save/restore of Gradle User Home by `gradle-build-action` - # See https://github.com/marketplace/actions/gradle-build-action?version=v2.1.1#cache-debugging-and-analysis - GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true - GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: "2022.07.23" -jobs: - setup: - runs-on: ubuntu-latest - outputs: - gradlew_flags: ${{ steps.global-constants.outputs.gradlew_flags }} - steps: - - name: "Setup global constants" - id: global-constants - # The configuration-cache cannot be used due to state excluded when caching Gradle User Home - run: | - set -x - GRADLEW_FLAGS="-Dorg.gradle.internal.http.connectionTimeout=60000 \ - -Dorg.gradle.internal.http.socketTimeout=60000 \ - -Dorg.gradle.internal.repository.max.retries=20 \ - -Dorg.gradle.internal.repository.initial.backoff=500 \ - --no-configuration-cache \ - --stacktrace" - echo "::set-output name=gradlew_flags::$GRADLEW_FLAGS" - - name: Publish build scans link - # No scans are produced for PRs from forked repos, so omit this notice for forked PRs. - if: ${{ !(github.event.pull_request && github.event.pull_request.head.repo.fork) }} - run: echo "::notice title=All build scans for workflow::https://ge.androidx.dev/scans?search.names=CI%20run&search.values=$GITHUB_RUN_ID" - - lint: - runs-on: ubuntu-latest - needs: [setup] - outputs: - status: ${{ steps.output-status.outputs.status }} - affectedFileArgs: ${{ steps.affected-file-args.outputs.files }} - env: - GRADLE_BUILD_CACHE_PASSWORD: ${{ secrets.GRADLE_BUILD_CACHE_PASSWORD }} - GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - steps: - - name: Pull request format - uses: 'androidx/check-pr-format-action@main' - with: - # Enforces a `Test: ` in the pull request - checks: '["(.*)?Test:(.*)?"]' - - - name: "Setup JDK 17" - id: setup-java - uses: actions/setup-java@v1 - with: - java-version: "17" - - - name: "Set environment variables" - shell: bash - run: | - set -x - echo "DIST_DIR=$HOME/dist" >> $GITHUB_ENV - - - name: "Checkout androidx repo" - uses: actions/checkout@v2 - - - name: "Get changed files in push or pull_request" - id: changed-files - uses: androidx/changed-files-action@main - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - - - name: "Warn on missing updateApi" - run: | - set -x - ./development/apilint.py -f ${{ steps.changed-files.outputs.files }} - - - name: "Parse changed-files as ktlint args" - id: ktlint-file-args - run: | - set -x - KTLINT_FILES=`echo "${{ steps.changed-files.outputs.files }}" | sed 's|[^ ]* *|--file=../&|g' | grep -v "*.txt"` - echo "::set-output name=ktlint-file-args::$KTLINT_FILES" - - - name: "Parse changed-files as affected files args" - id: affected-file-args - run: | - set -x - AFFECTED_FILES=`echo "${{ steps.changed-files.outputs.files_including_removals }}" | sed 's|\([^ ]\+\)|--changedFilePath=\1|g'` - echo "::set-output name=files::$AFFECTED_FILES" - - - name: "Setup Gradle" - uses: gradle/gradle-build-action@v2 - with: - # Only save Gradle User Home state for builds on the 'androidx-main' branch. - # Builds on other branches will only read existing entries from the cache. - cache-read-only: ${{ github.ref != 'refs/heads/androidx-main' }} - - # Don't reuse cache entries from any other Job. - gradle-home-cache-strict-match: true - - # Limit the size of the cache entry. - # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. - gradle-home-cache-excludes: | - caches/jars-9 - caches/transforms-3 - - - name: "ktlint" - env: - JAVA_HOME: ${{ steps.setup-java.outputs.path }} - working-directory: activity - run: ./gradlew -q :ktlintCheckFile ${{ steps.ktlint-file-args.outputs.ktlint-file-args }} ${{ needs.setup.outputs.gradlew_flags }} - - build-modules: - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - # If you would like to remove some projects temporarily, use .github/ci-control/ci-config.json instead. - # Keep these in alphabetical order. - project: ["activity", "appcompat", "biometric", "collection", "compose-runtime", "core", "datastore", "fragment", "lifecycle", "navigation", "paging", "room", "work"] - include: - - project: "compose-runtime" - project-root: "compose/runtime" - - project: "collection" - custom-os: "macos-latest" - runs-on: ${{ matrix.custom-os || matrix.os }} - needs: [setup, lint] - env: - artifact-id: ${{matrix.project}} - project-root: ${{matrix.project-root || matrix.project}} - GRADLE_BUILD_CACHE_PASSWORD: ${{ secrets.GRADLE_BUILD_CACHE_PASSWORD }} - GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - steps: - - name: "Checkout androidx repo" - uses: actions/checkout@v2 - - name: "Check if the project should be built" - id: check-ci-config - env: - BRANCH_REF: ${{ github.head_ref || github.ref }} - run: | - set -x - RESULT=`.github/ci-control/should_run_project.py --project ${{ matrix.project }} --branch "$BRANCH_REF"` - echo "::set-output name=enabled::$RESULT" - - name: "Run build" - uses: ./.github/actions/build-single-project - if: ${{ steps.check-ci-config.outputs.enabled == 'true' }} - with: - project: ${{ matrix.project }} - project-root: ${{matrix.project-root || matrix.project }} - gradle-cache-password: ${{ secrets.GRADLE_BUILD_CACHE_PASSWORD }} - gradle-enterprise-access-key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - gradle-flags: ${{ needs.setup.outputs.gradlew_flags }} - # Upload artifacts task should be in the build-single-project - # action but they have a tendency to fail and continue-on-error - # is not supported there yet. - # https://github.com/actions/runner/issues/1457 - - name: "Upload build artifacts" - continue-on-error: true - if: ${{ steps.check-ci-config.outputs.enabled == 'true' }} - uses: actions/upload-artifact@v2 - with: - name: artifacts_${{ matrix.project }} - path: ~/dist - - name: "Upload daemon logs" - continue-on-error: true - if: failure() - uses: actions/upload-artifact@v2 - with: - name: gradle-daemon-logs_${{ matrix.project }} - path: ~/.gradle/daemon diff --git a/.github/workflows/prune_artifacts.yml b/.github/workflows/prune_artifacts.yml deleted file mode 100644 index 28a1ca0dabd3e..0000000000000 --- a/.github/workflows/prune_artifacts.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: "Prune old artifacts" -on: - workflow_dispatch: - -jobs: - delete-artifacts: - runs-on: ubuntu-latest - steps: - - uses: kolpav/purge-artifacts-action@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - expire-in: 7days - diff --git a/.github/workflows/register_workflow_start.yml b/.github/workflows/register_workflow_start.yml deleted file mode 100644 index 77b9bd1561c94..0000000000000 --- a/.github/workflows/register_workflow_start.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Register Workflow Run with AndroidX -on: - workflow_dispatch: - -jobs: - ping_androidx_dev: - if: ${{ !github.event.repository.fork }} - runs-on: ubuntu-latest - name: "Start webhook" - steps: - - name: "Ping AndroidX hook" - uses: androidx/github-workflow-webhook-action@main - with: - url: 'https://androidx.dev/github/androidX/presubmit/hook' - secret: ${{ secrets.ANDROIDX_PRESUBMIT_HOOK_SECRET }} - payload: '{ "platform": "all", "token": "${{ secrets.GITHUB_TOKEN }}", "state": "started", "src" : "workflow_run"}' diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml deleted file mode 100644 index 8a3615a9a3739..0000000000000 --- a/.github/workflows/scorecards.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Scorecards supply-chain security -on: - workflow_dispatch: - -# Declare default permissions as read only. -permissions: read-all - -jobs: - analysis: - name: Scorecards analysis - runs-on: ubuntu-latest - permissions: - # Needed to upload the results to code-scanning dashboard. - security-events: write - actions: read - contents: read - - steps: - - name: "Checkout code" - uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0 - with: - persist-credentials: false - - - name: "Run analysis" - uses: ossf/scorecard-action@c1aec4ac820532bab364f02a81873c555a0ba3a1 # v1.0.4 - with: - results_file: results.sarif - results_format: sarif - # Read-only PAT token. To create it, - # follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation. - repo_token: ${{ secrets.SCORECARD_READ_TOKEN }} - # Publish the results to enable scorecard badges. For more details, see - # https://github.com/ossf/scorecard-action#publishing-results. - # For private repositories, `publish_results` will automatically be set to `false`, - # regardless of the value entered here. - publish_results: true - - # Upload the results as artifacts (optional). - - name: "Upload artifact" - uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0 - with: - name: SARIF file - path: results.sarif - retention-days: 5 - - # Upload the results to GitHub's code scanning dashboard. - - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # v1.0.26 - with: - sarif_file: results.sarif - diff --git a/.github/workflows/update_prebuilts.yml b/.github/workflows/update_prebuilts.yml deleted file mode 100644 index 08f01d6499cd5..0000000000000 --- a/.github/workflows/update_prebuilts.yml +++ /dev/null @@ -1,46 +0,0 @@ -# This workflow creates a new PR with the updated build ids for Playground prebuilts. -# To run it, navigate to https://github.com/androidx/androidx/actions/workflows/update_prebuilts.yml -# and click "Run workflow" -name: Update Prebuilts -on: - workflow_dispatch: - -jobs: - update-prebuilts: - runs-on: ubuntu-latest - steps: - - name: "Checkout androidx repo" - uses: actions/checkout@v2 - - name: "Run update prebuilt snapshot ids script" - shell: bash - run: development/update_playground.sh - - name: "Check if anything changed" - shell: bash - id: "check-for-changes" - run: | - set -x - git status - HAS_CHANGES=`git status --porcelain|grep playground\.properties|wc -l` - echo "::set-output name=has_changes::$HAS_CHANGES" - - name: "Create a PR" - shell: bash - id: "create-pr" - if: ${{ steps.check-for-changes.outputs.has_changes >= 1 }} - run: | - set -x - BRANCH_NAME="ci-workflow-bot/update-prebuilts-$(date "+%Y-%m-%d-%H-%M")/${{ github.run_id }}-${{ github.run_number }}" - git config user.email "androidx-github-bot@google.com" - git config user.name "AndroidX Github Bot" - git checkout -b $BRANCH_NAME - git add playground-common/playground.properties - git commit -m "Update playground snapshot ids" # PR body overrides this commit message - git push origin $BRANCH_NAME - # create pull request - gh pr create --base ${{ github.event.inputs.target-branch || 'androidx-main' }} \ - --title "[AndroidX Github Bot] Update playground snapshot ids" \ - --body "This CL was created by the update_prebuilts workflow. - ${{ github.event.inputs.comment || '' }} - Bug: n/a - Test: CI" - env: - GITHUB_TOKEN: ${{ secrets.ANDROIDX_GITHUB_BOT_TOKEN }} From 404791bfc7b860b02cd07a3663972c0e808c5b54 Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 18 Sep 2025 10:08:37 +0200 Subject: [PATCH 02/30] Run Pull Request Checks on GitHub Actions --- .github/workflows/cfw.yml | 24 ---- .github/workflows/compose-tests.yml | 209 ++++++++++++++++++++++++++++ 2 files changed, 209 insertions(+), 24 deletions(-) delete mode 100644 .github/workflows/cfw.yml create mode 100644 .github/workflows/compose-tests.yml diff --git a/.github/workflows/cfw.yml b/.github/workflows/cfw.yml deleted file mode 100644 index f5f25b42ddf19..0000000000000 --- a/.github/workflows/cfw.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: CfW tests -on: - workflow_dispatch: - pull_request: - push: - branches: - - "jb-main" - -jobs: - cfw-tests: - runs-on: ubuntu-24.04 - name: CfW tests - steps: - - name: Print dependencies versions - run: | - google-chrome-stable --version - - uses: actions/checkout@v3 - - name: Set up JDK 21 - uses: actions/setup-java@v3 - with: - java-version: '21' - distribution: 'zulu' - - name: Run CfW tests - run: xvfb-run -a ./gradlew :mpp:testWeb --no-parallel diff --git a/.github/workflows/compose-tests.yml b/.github/workflows/compose-tests.yml new file mode 100644 index 0000000000000..270e359981071 --- /dev/null +++ b/.github/workflows/compose-tests.yml @@ -0,0 +1,209 @@ +name: Compose Tests +on: + workflow_dispatch: + pull_request: + push: + branches: + - jb-main + +jobs: + check-public-api: + runs-on: macos-15 + name: Build Native & Check Public API + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'corretto' + + - name: Setup Android SDK + uses: android-actions/setup-android@v2 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Build Native + run: | + ./gradlew publishComposeJb -Pcompose.platforms=macos,uikit,linux,mingw \ + --no-daemon --stacktrace --info --rerun-tasks + + - name: Check Public API + run: | + ./gradlew jbApiCheck \ + --no-daemon --stacktrace --info --rerun-tasks + + compose-desktop-tests: + runs-on: ubuntu-24.04 + name: Compose Desktop Tests + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'corretto' + + - name: Setup Android SDK + uses: android-actions/setup-android@v2 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - 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 --info --rerun-tasks \ + -Pandroidx.ignoreTestFailures + + - 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 + name: Compose iOS Tests + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'corretto' + + - name: Setup Android SDK + uses: android-actions/setup-android@v2 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Run iOS UIKit Tests + run: | + ./gradlew testUIKit \ + --no-daemon --stacktrace --info --rerun-tasks + + - name: Run iOS UIKit Instrumented Tests + run: | + .jb-ciscripts/PullRequests/UIKitInstrumentedTests.sh + + - name: Run CMPUIKitUtils Framework Tests + working-directory: compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils + run: | + xcodebuild test -scheme CMPUIKitUtilsTests -project CMPUIKitUtils.xcodeproj -destination 'platform=iOS Simulator,name=iPhone 16' + + - name: Test Summary + uses: test-summary/action@v2 + with: + paths: "out/**/build/test-results/**/TEST-*.xml" + if: always() + + compose-web-chrome-tests: + runs-on: ubuntu-24.04 + name: Compose Web Chrome Tests + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'corretto' + + - name: Setup Android SDK + uses: android-actions/setup-android@v2 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Print Dependencies Versions + run: | + google-chrome-stable --version + + - 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 + --no-daemon --stacktrace --info --rerun-tasks --no-parallel + + - 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: + matrix: + firefox: [ '119.0', 'latest' ] + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'corretto' + + - name: Setup Android SDK + uses: android-actions/setup-android@v2 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - 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 - UI + run: | + ./gradlew :compose:ui:ui:wasmJsBrowserTest :compose:ui:ui-text:wasmJsBrowserTest \ + --no-daemon --stacktrace --info --rerun-tasks --no-parallel \ + -Pandroidx.ignoreTestFailures \ + -Pjetbrains.androidx.web.tests.enableFirefox=true \ + -Pjetbrains.androidx.web.tests.enableChrome=false + + - name: Run Web Firefox Tests - Foundation, Material3 + run: | + ./gradlew :compose:foundation:foundation:wasmJsBrowserTest :compose:material3:material3:wasmJsBrowserTest \ + --no-daemon --stacktrace --info --rerun-tasks --no-parallel \ + -Pandroidx.ignoreTestFailures \ + -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() From 2ffa44f8ac4c8e8f6febd483c438c1fb04a90440 Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 18 Sep 2025 12:26:06 +0200 Subject: [PATCH 03/30] Enable gradle cache --- .github/workflows/compose-tests.yml | 60 +++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/.github/workflows/compose-tests.yml b/.github/workflows/compose-tests.yml index 270e359981071..8d0dd6fdc64a9 100644 --- a/.github/workflows/compose-tests.yml +++ b/.github/workflows/compose-tests.yml @@ -23,6 +23,18 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 + with: + # Only save Gradle User Home state for builds on the 'jb-main' branch. + # Builds on other branches will only read existing entries from the cache. + cache-read-only: false + # Replace with this before merging + # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} + + # Limit the size of the cache entry. + # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. + gradle-home-cache-excludes: | + caches/jars-9 + caches/transforms-3 - name: Build Native run: | @@ -50,6 +62,18 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 + with: + # Only save Gradle User Home state for builds on the 'jb-main' branch. + # Builds on other branches will only read existing entries from the cache. + cache-read-only: false + # Replace with this before merging + # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} + + # Limit the size of the cache entry. + # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. + gradle-home-cache-excludes: | + caches/jars-9 + caches/transforms-3 - name: Start X Server run: | @@ -93,6 +117,18 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 + with: + # Only save Gradle User Home state for builds on the 'jb-main' branch. + # Builds on other branches will only read existing entries from the cache. + cache-read-only: false + # Replace with this before merging + # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} + + # Limit the size of the cache entry. + # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. + gradle-home-cache-excludes: | + caches/jars-9 + caches/transforms-3 - name: Run iOS UIKit Tests run: | @@ -130,6 +166,18 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 + with: + # Only save Gradle User Home state for builds on the 'jb-main' branch. + # Builds on other branches will only read existing entries from the cache. + cache-read-only: false + # Replace with this before merging + # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} + + # Limit the size of the cache entry. + # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. + gradle-home-cache-excludes: | + caches/jars-9 + caches/transforms-3 - name: Print Dependencies Versions run: | @@ -170,6 +218,18 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 + with: + # Only save Gradle User Home state for builds on the 'jb-main' branch. + # Builds on other branches will only read existing entries from the cache. + cache-read-only: false + # Replace with this before merging + # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} + + # Limit the size of the cache entry. + # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. + gradle-home-cache-excludes: | + caches/jars-9 + caches/transforms-3 - name: Setup Missing Packages run: | From 6db3138e6766186c8abcb6b6e5d647e37f6fb809 Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 18 Sep 2025 13:03:59 +0200 Subject: [PATCH 04/30] Run all tests on Firefox, use version matrix for chrome --- .github/workflows/compose-tests.yml | 32 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/compose-tests.yml b/.github/workflows/compose-tests.yml index 8d0dd6fdc64a9..d9b06cca44ed5 100644 --- a/.github/workflows/compose-tests.yml +++ b/.github/workflows/compose-tests.yml @@ -153,6 +153,10 @@ jobs: compose-web-chrome-tests: runs-on: ubuntu-24.04 name: Compose Web Chrome Tests + strategy: + matrix: + chrome: [ '118', 'stable' ] + task: [ ':mpp:testWebJs', ':mpp:testWebWasm' ] steps: - uses: actions/checkout@v5 @@ -179,9 +183,11 @@ jobs: caches/jars-9 caches/transforms-3 - - name: Print Dependencies Versions - run: | - google-chrome-stable --version + - uses: browser-actions/setup-chrome@v2 + with: + chrome-version: ${{ matrix.chrome }} + install-chromedriver: true + install-dependencies: true - name: Start X Server run: | @@ -190,8 +196,10 @@ jobs: - name: Run Web Chrome Tests run: | - ./gradlew :mpp:testWeb - --no-daemon --stacktrace --info --rerun-tasks --no-parallel + ./gradlew ${{ matrix.task }} \ + --no-daemon --stacktrace --info --rerun-tasks --no-parallel \ + -Pjetbrains.androidx.web.tests.enableFirefox=false \ + -Pjetbrains.androidx.web.tests.enableChrome=true - name: Test Summary uses: test-summary/action@v2 @@ -205,6 +213,7 @@ jobs: strategy: matrix: firefox: [ '119.0', 'latest' ] + task: [ ':mpp:testWebJs', ':mpp:testWebWasm' ] steps: - uses: actions/checkout@v5 @@ -246,19 +255,10 @@ jobs: sudo Xvfb :1 -screen 0 1920x1080x24 -extension RANDR +extension GLX & echo "DISPLAY=:1.0" >> $GITHUB_ENV - - name: Run Web Firefox Tests - UI - run: | - ./gradlew :compose:ui:ui:wasmJsBrowserTest :compose:ui:ui-text:wasmJsBrowserTest \ - --no-daemon --stacktrace --info --rerun-tasks --no-parallel \ - -Pandroidx.ignoreTestFailures \ - -Pjetbrains.androidx.web.tests.enableFirefox=true \ - -Pjetbrains.androidx.web.tests.enableChrome=false - - - name: Run Web Firefox Tests - Foundation, Material3 + - name: Run Web Firefox Tests run: | - ./gradlew :compose:foundation:foundation:wasmJsBrowserTest :compose:material3:material3:wasmJsBrowserTest \ + ./gradlew ${{ matrix.task }} \ --no-daemon --stacktrace --info --rerun-tasks --no-parallel \ - -Pandroidx.ignoreTestFailures \ -Pjetbrains.androidx.web.tests.enableFirefox=true \ -Pjetbrains.androidx.web.tests.enableChrome=false From ddb06da0a4d2e7540ec77521de64270c611a1341 Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 18 Sep 2025 13:21:53 +0200 Subject: [PATCH 05/30] Reuse cache if available, less verbose logs --- .github/workflows/compose-tests.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/compose-tests.yml b/.github/workflows/compose-tests.yml index d9b06cca44ed5..9e773bc54ebfb 100644 --- a/.github/workflows/compose-tests.yml +++ b/.github/workflows/compose-tests.yml @@ -39,12 +39,12 @@ jobs: - name: Build Native run: | ./gradlew publishComposeJb -Pcompose.platforms=macos,uikit,linux,mingw \ - --no-daemon --stacktrace --info --rerun-tasks + --no-daemon --stacktrace - name: Check Public API run: | ./gradlew jbApiCheck \ - --no-daemon --stacktrace --info --rerun-tasks + --no-daemon --stacktrace compose-desktop-tests: runs-on: ubuntu-24.04 @@ -83,7 +83,7 @@ jobs: - name: Run Desktop Tests run: | ./gradlew testDesktop \ - --no-daemon --stacktrace --info --rerun-tasks \ + --no-daemon --stacktrace \ -Pandroidx.ignoreTestFailures - name: Upload Screenshots @@ -133,7 +133,7 @@ jobs: - name: Run iOS UIKit Tests run: | ./gradlew testUIKit \ - --no-daemon --stacktrace --info --rerun-tasks + --no-daemon --stacktrace - name: Run iOS UIKit Instrumented Tests run: | @@ -197,7 +197,7 @@ jobs: - name: Run Web Chrome Tests run: | ./gradlew ${{ matrix.task }} \ - --no-daemon --stacktrace --info --rerun-tasks --no-parallel \ + --no-daemon --stacktrace --no-parallel \ -Pjetbrains.androidx.web.tests.enableFirefox=false \ -Pjetbrains.androidx.web.tests.enableChrome=true @@ -258,7 +258,7 @@ jobs: - name: Run Web Firefox Tests run: | ./gradlew ${{ matrix.task }} \ - --no-daemon --stacktrace --info --rerun-tasks --no-parallel \ + --no-daemon --stacktrace --no-parallel \ -Pjetbrains.androidx.web.tests.enableFirefox=true \ -Pjetbrains.androidx.web.tests.enableChrome=false From 7a779534225e1e59d69d25993099232057e9fa10 Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 18 Sep 2025 14:56:42 +0200 Subject: [PATCH 06/30] Disable fail-fast strategy in web tests --- .github/workflows/compose-tests.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/compose-tests.yml b/.github/workflows/compose-tests.yml index 9e773bc54ebfb..9d595a3c1c92c 100644 --- a/.github/workflows/compose-tests.yml +++ b/.github/workflows/compose-tests.yml @@ -154,9 +154,10 @@ jobs: runs-on: ubuntu-24.04 name: Compose Web Chrome Tests strategy: + fail-fast: false matrix: chrome: [ '118', 'stable' ] - task: [ ':mpp:testWebJs', ':mpp:testWebWasm' ] + task: [ 'Js', 'Wasm' ] steps: - uses: actions/checkout@v5 @@ -196,7 +197,7 @@ jobs: - name: Run Web Chrome Tests run: | - ./gradlew ${{ matrix.task }} \ + ./gradlew :mpp:testWeb${{ matrix.task }} \ --no-daemon --stacktrace --no-parallel \ -Pjetbrains.androidx.web.tests.enableFirefox=false \ -Pjetbrains.androidx.web.tests.enableChrome=true @@ -211,9 +212,10 @@ jobs: runs-on: ubuntu-24.04 name: Compose Web Firefox Tests strategy: + fail-fast: false matrix: firefox: [ '119.0', 'latest' ] - task: [ ':mpp:testWebJs', ':mpp:testWebWasm' ] + task: [ 'Js', 'Wasm' ] steps: - uses: actions/checkout@v5 @@ -257,7 +259,7 @@ jobs: - name: Run Web Firefox Tests run: | - ./gradlew ${{ matrix.task }} \ + ./gradlew :mpp:testWeb${{ matrix.task }} \ --no-daemon --stacktrace --no-parallel \ -Pjetbrains.androidx.web.tests.enableFirefox=true \ -Pjetbrains.androidx.web.tests.enableChrome=false From 675603aa19ef336f91cf04323e98fb3cc253831b Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 18 Sep 2025 15:12:29 +0200 Subject: [PATCH 07/30] Move check API and publish dry run to separate actions --- .github/workflows/check-public-api.yml | 42 +++++++ .github/workflows/compose-publish-dry-run.yml | 110 ++++++++++++++++++ .github/workflows/compose-tests.yml | 39 ------- 3 files changed, 152 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/check-public-api.yml create mode 100644 .github/workflows/compose-publish-dry-run.yml diff --git a/.github/workflows/check-public-api.yml b/.github/workflows/check-public-api.yml new file mode 100644 index 0000000000000..cc787a5ac4617 --- /dev/null +++ b/.github/workflows/check-public-api.yml @@ -0,0 +1,42 @@ +name: Check Public API +on: + workflow_dispatch: + pull_request: + push: + branches: + - jb-main + +jobs: + check-public-api: + runs-on: macos-15 + name: Check Public API + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'corretto' + + - name: Setup Android SDK + uses: android-actions/setup-android@v2 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + with: + # Only save Gradle User Home state for builds on the 'jb-main' branch. + # Builds on other branches will only read existing entries from the cache. + cache-read-only: false + # Replace with this before merging + # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} + + # Limit the size of the cache entry. + # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. + gradle-home-cache-excludes: | + caches/jars-9 + caches/transforms-3 + + - name: Check Public API + run: | + ./gradlew jbApiCheck \ + --no-daemon --stacktrace diff --git a/.github/workflows/compose-publish-dry-run.yml b/.github/workflows/compose-publish-dry-run.yml new file mode 100644 index 0000000000000..d50c658a4a063 --- /dev/null +++ b/.github/workflows/compose-publish-dry-run.yml @@ -0,0 +1,110 @@ +name: Compose Publish Dry Run +on: + workflow_dispatch: + pull_request: + push: + branches: + - jb-main + +jobs: + compose-native-publish: + runs-on: macos-15 + name: Dry Run Compose Publish Darwin + Native Linux + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'corretto' + + - name: Setup Android SDK + uses: android-actions/setup-android@v2 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + with: + # Only save Gradle User Home state for builds on the 'jb-main' branch. + # Builds on other branches will only read existing entries from the cache. + cache-read-only: false + # Replace with this before merging + # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} + + # Limit the size of the cache entry. + # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. + gradle-home-cache-excludes: | + caches/jars-9 + caches/transforms-3 + + - name: Compose Publish Darwin + Native Linux + run: | + ./gradlew publishComposeJb -Pcompose.platforms=macos,uikit,tvos,watchos,linux,mingw \ + --no-daemon --stacktrace + + compose-web-publish: + runs-on: ubuntu-24.04 + name: Dry Run Compose Publish Web + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'corretto' + + - name: Setup Android SDK + uses: android-actions/setup-android@v2 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + with: + # Only save Gradle User Home state for builds on the 'jb-main' branch. + # Builds on other branches will only read existing entries from the cache. + cache-read-only: false + # Replace with this before merging + # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} + + # Limit the size of the cache entry. + # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. + gradle-home-cache-excludes: | + caches/jars-9 + caches/transforms-3 + + - name: Compose Publish Web + run: | + ./gradlew publishComposeJb -Pcompose.platforms=web \ + --no-daemon --stacktrace + + compose-jvm-publish: + runs-on: ubuntu-24.04 + name: Dry Run Compose Publish JVM + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'corretto' + + - name: Setup Android SDK + uses: android-actions/setup-android@v2 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + with: + # Only save Gradle User Home state for builds on the 'jb-main' branch. + # Builds on other branches will only read existing entries from the cache. + cache-read-only: false + # Replace with this before merging + # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} + + # Limit the size of the cache entry. + # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. + gradle-home-cache-excludes: | + caches/jars-9 + caches/transforms-3 + + - name: Compose Publish JVM + run: | + ./gradlew publishComposeJb -Pcompose.platforms=jvm,android \ + --no-daemon --stacktrace diff --git a/.github/workflows/compose-tests.yml b/.github/workflows/compose-tests.yml index 9d595a3c1c92c..9ec6021d817d4 100644 --- a/.github/workflows/compose-tests.yml +++ b/.github/workflows/compose-tests.yml @@ -7,45 +7,6 @@ on: - jb-main jobs: - check-public-api: - runs-on: macos-15 - name: Build Native & Check Public API - steps: - - uses: actions/checkout@v5 - - - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'corretto' - - - name: Setup Android SDK - uses: android-actions/setup-android@v2 - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - with: - # Only save Gradle User Home state for builds on the 'jb-main' branch. - # Builds on other branches will only read existing entries from the cache. - cache-read-only: false - # Replace with this before merging - # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} - - # Limit the size of the cache entry. - # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. - gradle-home-cache-excludes: | - caches/jars-9 - caches/transforms-3 - - - name: Build Native - run: | - ./gradlew publishComposeJb -Pcompose.platforms=macos,uikit,linux,mingw \ - --no-daemon --stacktrace - - - name: Check Public API - run: | - ./gradlew jbApiCheck \ - --no-daemon --stacktrace - compose-desktop-tests: runs-on: ubuntu-24.04 name: Compose Desktop Tests From 10ebbc9d4d1ee3bd844a66a3fb85145c81a0daac Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 18 Sep 2025 15:16:19 +0200 Subject: [PATCH 08/30] Ignore flaky tests with TODOs --- ...asmJs.kt => IgnoreTargetsActuals.uikit.kt} | 0 .../kotlin/kotlinx/test/IgnoreTargets.kt | 25 +++++++++++++++++++ .../kotlin/kotlinx/test/IgnoreTargets.js.kt | 19 ++++++++++++++ .../compose/ui/text/SkikoParagraphTest.kt | 4 +++ .../androidx/compose/ui/text/StringTest.kt | 4 +++ .../platform/SkiaParagraphIntrinsicsTest.kt | 4 +++ .../test/IgnoreTargetsActuals.wasmJs.kt | 19 ++++++++++++++ compose/ui/ui/build.gradle | 15 ++++++----- 8 files changed, 84 insertions(+), 6 deletions(-) rename compose/foundation/foundation/src/uikitTest/kotlin/kotlinx/test/{IgnoreTargetsActuals.wasmJs.kt => IgnoreTargetsActuals.uikit.kt} (100%) create mode 100644 compose/ui/ui-text/src/commonTest/kotlin/kotlinx/test/IgnoreTargets.kt create mode 100644 compose/ui/ui-text/src/jsTest/kotlin/kotlinx/test/IgnoreTargets.js.kt create mode 100644 compose/ui/ui-text/src/wasmJsTest/kotlin/kotlinx/test/IgnoreTargetsActuals.wasmJs.kt diff --git a/compose/foundation/foundation/src/uikitTest/kotlin/kotlinx/test/IgnoreTargetsActuals.wasmJs.kt b/compose/foundation/foundation/src/uikitTest/kotlin/kotlinx/test/IgnoreTargetsActuals.uikit.kt similarity index 100% rename from compose/foundation/foundation/src/uikitTest/kotlin/kotlinx/test/IgnoreTargetsActuals.wasmJs.kt rename to compose/foundation/foundation/src/uikitTest/kotlin/kotlinx/test/IgnoreTargetsActuals.uikit.kt diff --git a/compose/ui/ui-text/src/commonTest/kotlin/kotlinx/test/IgnoreTargets.kt b/compose/ui/ui-text/src/commonTest/kotlin/kotlinx/test/IgnoreTargets.kt new file mode 100644 index 0000000000000..7e3a38fe8fe3b --- /dev/null +++ b/compose/ui/ui-text/src/commonTest/kotlin/kotlinx/test/IgnoreTargets.kt @@ -0,0 +1,25 @@ +/* + * Copyright 2025 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@file:OptIn(ExperimentalMultiplatform::class) + +package kotlinx.test + +@OptionalExpectation +expect annotation class IgnoreWasmTarget() + +@OptionalExpectation +expect annotation class IgnoreJsTarget() diff --git a/compose/ui/ui-text/src/jsTest/kotlin/kotlinx/test/IgnoreTargets.js.kt b/compose/ui/ui-text/src/jsTest/kotlin/kotlinx/test/IgnoreTargets.js.kt new file mode 100644 index 0000000000000..5a227ceeef3c8 --- /dev/null +++ b/compose/ui/ui-text/src/jsTest/kotlin/kotlinx/test/IgnoreTargets.js.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2025 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package kotlinx.test + +actual typealias IgnoreJsTarget = kotlin.test.Ignore diff --git a/compose/ui/ui-text/src/skikoTest/kotlin/androidx/compose/ui/text/SkikoParagraphTest.kt b/compose/ui/ui-text/src/skikoTest/kotlin/androidx/compose/ui/text/SkikoParagraphTest.kt index a9593ced564ba..dfe0a936e2cf1 100644 --- a/compose/ui/ui-text/src/skikoTest/kotlin/androidx/compose/ui/text/SkikoParagraphTest.kt +++ b/compose/ui/ui-text/src/skikoTest/kotlin/androidx/compose/ui/text/SkikoParagraphTest.kt @@ -27,8 +27,12 @@ import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertFailsWith import kotlin.test.assertNotEquals +import kotlinx.test.IgnoreJsTarget +import kotlinx.test.IgnoreWasmTarget // Adopted tests from text/text/src/androidTest/java/androidx/compose/ui/text/android/selection/WordBoundaryTest.kt +@IgnoreJsTarget // FIXME https://youtrack.jetbrains.com/issue/CMP-8955 +@IgnoreWasmTarget class SkikoParagraphTest { private val fontFamilyResolver = createFontFamilyResolver() private val defaultDensity = Density(density = 1f) diff --git a/compose/ui/ui-text/src/skikoTest/kotlin/androidx/compose/ui/text/StringTest.kt b/compose/ui/ui-text/src/skikoTest/kotlin/androidx/compose/ui/text/StringTest.kt index b1ee4726a6d7a..43201ee1d1e21 100644 --- a/compose/ui/ui-text/src/skikoTest/kotlin/androidx/compose/ui/text/StringTest.kt +++ b/compose/ui/ui-text/src/skikoTest/kotlin/androidx/compose/ui/text/StringTest.kt @@ -19,6 +19,8 @@ package androidx.compose.ui.text import androidx.compose.ui.text.intl.Locale import androidx.compose.ui.text.intl.LocaleList import kotlin.test.* +import kotlinx.test.IgnoreJsTarget +import kotlinx.test.IgnoreWasmTarget class StringTest { @@ -56,6 +58,8 @@ class StringTest { assertEquals(uppercase.decapitalize(serbianLocale), lowercase) } + @IgnoreJsTarget // FIXME https://youtrack.jetbrains.com/issue/CMP-8955 + @IgnoreWasmTarget @Test fun directionality() { assertEquals(StrongDirectionType.None, '0'.code.strongDirectionType()) // Number diff --git a/compose/ui/ui-text/src/skikoTest/kotlin/androidx/compose/ui/text/platform/SkiaParagraphIntrinsicsTest.kt b/compose/ui/ui-text/src/skikoTest/kotlin/androidx/compose/ui/text/platform/SkiaParagraphIntrinsicsTest.kt index 7c8c0a3a3c890..aa7eeb64ee526 100644 --- a/compose/ui/ui-text/src/skikoTest/kotlin/androidx/compose/ui/text/platform/SkiaParagraphIntrinsicsTest.kt +++ b/compose/ui/ui-text/src/skikoTest/kotlin/androidx/compose/ui/text/platform/SkiaParagraphIntrinsicsTest.kt @@ -22,7 +22,11 @@ import androidx.compose.ui.text.style.ResolvedTextDirection import androidx.compose.ui.text.style.TextDirection import kotlin.test.Test import kotlin.test.assertEquals +import kotlinx.test.IgnoreJsTarget +import kotlinx.test.IgnoreWasmTarget +@IgnoreJsTarget // FIXME https://youtrack.jetbrains.com/issue/CMP-8955 +@IgnoreWasmTarget class SkiaParagraphIntrinsicsTest { @Test diff --git a/compose/ui/ui-text/src/wasmJsTest/kotlin/kotlinx/test/IgnoreTargetsActuals.wasmJs.kt b/compose/ui/ui-text/src/wasmJsTest/kotlin/kotlinx/test/IgnoreTargetsActuals.wasmJs.kt new file mode 100644 index 0000000000000..c1ff5e83ed34e --- /dev/null +++ b/compose/ui/ui-text/src/wasmJsTest/kotlin/kotlinx/test/IgnoreTargetsActuals.wasmJs.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2025 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package kotlinx.test + +actual typealias IgnoreWasmTarget = kotlin.test.Ignore diff --git a/compose/ui/ui/build.gradle b/compose/ui/ui/build.gradle index bb31933407516..9621102b92062 100644 --- a/compose/ui/ui/build.gradle +++ b/compose/ui/ui/build.gradle @@ -253,6 +253,8 @@ if(AndroidXComposePlugin.isMultiplatformEnabled(project)) { } commonTest.dependencies { + implementation(libs.kotlinTest) + implementation(libs.kotlinCoroutinesTest) implementation(libs.kotlinReflect) } @@ -305,12 +307,13 @@ if(AndroidXComposePlugin.isMultiplatformEnabled(project)) { implementation("androidx.activity:activity-compose:1.7.0-rc01") } - skikoTest.dependencies { - implementation(libs.kotlinTest) - implementation(libs.kotlinCoroutinesTest) - implementation(project(":compose:material:material")) - implementation(project(":compose:foundation:foundation")) - implementation(project(":compose:ui:ui-test-junit4")) + skikoTest { + dependsOn(commonTest) + dependencies { + implementation(project(":compose:material:material")) + implementation(project(":compose:foundation:foundation")) + implementation(project(":compose:ui:ui-test-junit4")) + } } desktopTest { From e9c8982e644380c13d0bd4c04631c79e10ef4dc0 Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 18 Sep 2025 15:38:18 +0200 Subject: [PATCH 09/30] Reuse setup prerequisites steps --- .../actions/setup-prerequisites/action.yml | 27 ++++ .github/workflows/check-public-api.yml | 27 +--- .github/workflows/compose-publish-dry-run.yml | 81 ++--------- .github/workflows/compose-tests.yml | 137 +++++------------- 4 files changed, 82 insertions(+), 190 deletions(-) create mode 100644 .github/actions/setup-prerequisites/action.yml diff --git a/.github/actions/setup-prerequisites/action.yml b/.github/actions/setup-prerequisites/action.yml new file mode 100644 index 0000000000000..3949b9ca5a642 --- /dev/null +++ b/.github/actions/setup-prerequisites/action.yml @@ -0,0 +1,27 @@ +name: 'Setup Prerequisites' +runs: + using: "composite" + steps: + - name: Setup JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'corretto' + + - name: Setup Android SDK + uses: android-actions/setup-android@v2 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + with: + # Only save Gradle User Home state for builds on the 'jb-main' branch. + # Builds on other branches will only read existing entries from the cache. + cache-read-only: false + # Replace with this before merging + # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} + + # Limit the size of the cache entry. + # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. + gradle-home-cache-excludes: | + caches/jars-9 + caches/transforms-3 diff --git a/.github/workflows/check-public-api.yml b/.github/workflows/check-public-api.yml index cc787a5ac4617..e4c246e6b1ae9 100644 --- a/.github/workflows/check-public-api.yml +++ b/.github/workflows/check-public-api.yml @@ -11,30 +11,11 @@ jobs: runs-on: macos-15 name: Check Public API steps: - - uses: actions/checkout@v5 + - name: Checkout Repository + uses: actions/checkout@v5 - - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'corretto' - - - name: Setup Android SDK - uses: android-actions/setup-android@v2 - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - with: - # Only save Gradle User Home state for builds on the 'jb-main' branch. - # Builds on other branches will only read existing entries from the cache. - cache-read-only: false - # Replace with this before merging - # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} - - # Limit the size of the cache entry. - # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. - gradle-home-cache-excludes: | - caches/jars-9 - caches/transforms-3 + - name: Setup Prerequisites + uses: ./.github/actions/setup-prerequisites - name: Check Public API run: | diff --git a/.github/workflows/compose-publish-dry-run.yml b/.github/workflows/compose-publish-dry-run.yml index d50c658a4a063..b628ef4d1cebf 100644 --- a/.github/workflows/compose-publish-dry-run.yml +++ b/.github/workflows/compose-publish-dry-run.yml @@ -11,30 +11,11 @@ jobs: runs-on: macos-15 name: Dry Run Compose Publish Darwin + Native Linux steps: - - uses: actions/checkout@v5 + - name: Checkout Repository + uses: actions/checkout@v5 - - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'corretto' - - - name: Setup Android SDK - uses: android-actions/setup-android@v2 - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - with: - # Only save Gradle User Home state for builds on the 'jb-main' branch. - # Builds on other branches will only read existing entries from the cache. - cache-read-only: false - # Replace with this before merging - # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} - - # Limit the size of the cache entry. - # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. - gradle-home-cache-excludes: | - caches/jars-9 - caches/transforms-3 + - name: Setup Prerequisites + uses: ./.github/actions/setup-prerequisites - name: Compose Publish Darwin + Native Linux run: | @@ -45,30 +26,11 @@ jobs: runs-on: ubuntu-24.04 name: Dry Run Compose Publish Web steps: - - uses: actions/checkout@v5 - - - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'corretto' - - - name: Setup Android SDK - uses: android-actions/setup-android@v2 + - name: Checkout Repository + uses: actions/checkout@v5 - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - with: - # Only save Gradle User Home state for builds on the 'jb-main' branch. - # Builds on other branches will only read existing entries from the cache. - cache-read-only: false - # Replace with this before merging - # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} - - # Limit the size of the cache entry. - # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. - gradle-home-cache-excludes: | - caches/jars-9 - caches/transforms-3 + - name: Setup Prerequisites + uses: ./.github/actions/setup-prerequisites - name: Compose Publish Web run: | @@ -79,30 +41,11 @@ jobs: runs-on: ubuntu-24.04 name: Dry Run Compose Publish JVM steps: - - uses: actions/checkout@v5 - - - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'corretto' - - - name: Setup Android SDK - uses: android-actions/setup-android@v2 - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - with: - # Only save Gradle User Home state for builds on the 'jb-main' branch. - # Builds on other branches will only read existing entries from the cache. - cache-read-only: false - # Replace with this before merging - # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} + - name: Checkout Repository + uses: actions/checkout@v5 - # Limit the size of the cache entry. - # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. - gradle-home-cache-excludes: | - caches/jars-9 - caches/transforms-3 + - name: Setup Prerequisites + uses: ./.github/actions/setup-prerequisites - name: Compose Publish JVM run: | diff --git a/.github/workflows/compose-tests.yml b/.github/workflows/compose-tests.yml index 9ec6021d817d4..c5031c9e59018 100644 --- a/.github/workflows/compose-tests.yml +++ b/.github/workflows/compose-tests.yml @@ -11,30 +11,11 @@ jobs: runs-on: ubuntu-24.04 name: Compose Desktop Tests steps: - - uses: actions/checkout@v5 + - name: Checkout Repository + uses: actions/checkout@v5 - - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'corretto' - - - name: Setup Android SDK - uses: android-actions/setup-android@v2 - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - with: - # Only save Gradle User Home state for builds on the 'jb-main' branch. - # Builds on other branches will only read existing entries from the cache. - cache-read-only: false - # Replace with this before merging - # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} - - # Limit the size of the cache entry. - # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. - gradle-home-cache-excludes: | - caches/jars-9 - caches/transforms-3 + - name: Setup Prerequisites + uses: ./.github/actions/setup-prerequisites - name: Start X Server run: | @@ -66,40 +47,17 @@ jobs: runs-on: macos-15 name: Compose iOS Tests steps: - - uses: actions/checkout@v5 + - name: Checkout Repository + uses: actions/checkout@v5 - - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'corretto' - - - name: Setup Android SDK - uses: android-actions/setup-android@v2 + - name: Setup Prerequisites + uses: ./.github/actions/setup-prerequisites - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - with: - # Only save Gradle User Home state for builds on the 'jb-main' branch. - # Builds on other branches will only read existing entries from the cache. - cache-read-only: false - # Replace with this before merging - # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} - - # Limit the size of the cache entry. - # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. - gradle-home-cache-excludes: | - caches/jars-9 - caches/transforms-3 - - - name: Run iOS UIKit Tests + - name: Run iOS Tests run: | ./gradlew testUIKit \ --no-daemon --stacktrace - - name: Run iOS UIKit Instrumented Tests - run: | - .jb-ciscripts/PullRequests/UIKitInstrumentedTests.sh - - name: Run CMPUIKitUtils Framework Tests working-directory: compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils run: | @@ -111,6 +69,26 @@ jobs: paths: "out/**/build/test-results/**/TEST-*.xml" if: always() + compose-ios-instrumented-tests: + runs-on: macos-15 + name: Compose iOS Instrumented Tests + steps: + - name: Checkout Repository + uses: actions/checkout@v5 + + - name: Setup Prerequisites + uses: ./.github/actions/setup-prerequisites + + - name: Run iOS Instrumented Tests + run: | + .jb-ciscripts/PullRequests/UIKitInstrumentedTests.sh + + - name: Test Summary + uses: test-summary/action@v2 + with: + paths: "out/**/build/test-results/**/TEST-*.xml" + if: always() + compose-web-chrome-tests: runs-on: ubuntu-24.04 name: Compose Web Chrome Tests @@ -120,32 +98,14 @@ jobs: chrome: [ '118', 'stable' ] task: [ 'Js', 'Wasm' ] steps: - - uses: actions/checkout@v5 + - name: Checkout Repository + uses: actions/checkout@v5 - - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'corretto' - - - name: Setup Android SDK - uses: android-actions/setup-android@v2 + - name: Setup Prerequisites + uses: ./.github/actions/setup-prerequisites - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - with: - # Only save Gradle User Home state for builds on the 'jb-main' branch. - # Builds on other branches will only read existing entries from the cache. - cache-read-only: false - # Replace with this before merging - # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} - - # Limit the size of the cache entry. - # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. - gradle-home-cache-excludes: | - caches/jars-9 - caches/transforms-3 - - - uses: browser-actions/setup-chrome@v2 + - name: Setup Google Chrome + uses: browser-actions/setup-chrome@v2 with: chrome-version: ${{ matrix.chrome }} install-chromedriver: true @@ -178,30 +138,11 @@ jobs: firefox: [ '119.0', 'latest' ] task: [ 'Js', 'Wasm' ] steps: - - uses: actions/checkout@v5 + - name: Checkout Repository + uses: actions/checkout@v5 - - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'corretto' - - - name: Setup Android SDK - uses: android-actions/setup-android@v2 - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - with: - # Only save Gradle User Home state for builds on the 'jb-main' branch. - # Builds on other branches will only read existing entries from the cache. - cache-read-only: false - # Replace with this before merging - # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} - - # Limit the size of the cache entry. - # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. - gradle-home-cache-excludes: | - caches/jars-9 - caches/transforms-3 + - name: Setup Prerequisites + uses: ./.github/actions/setup-prerequisites - name: Setup Missing Packages run: | From 24cfb3f4be8d5fa1aa25bb12dda3e9defc7f7430 Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 18 Sep 2025 17:38:58 +0200 Subject: [PATCH 10/30] iOS tests: split back, set xcode to 16.2 and publish test results --- .github/workflows/compose-tests.yml | 58 +++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 7 deletions(-) diff --git a/.github/workflows/compose-tests.yml b/.github/workflows/compose-tests.yml index c5031c9e59018..4877c89237133 100644 --- a/.github/workflows/compose-tests.yml +++ b/.github/workflows/compose-tests.yml @@ -53,20 +53,50 @@ jobs: - name: Setup Prerequisites uses: ./.github/actions/setup-prerequisites + # List of available Xcode versions: + # https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode + - name: Setup Xcode version + run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer + - name: Run iOS Tests run: | ./gradlew testUIKit \ --no-daemon --stacktrace - - name: Run CMPUIKitUtils Framework Tests + - 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 + name: Compose iOS Utils Tests + steps: + - name: Checkout Repository + uses: actions/checkout@v5 + + - name: Setup Prerequisites + uses: ./.github/actions/setup-prerequisites + + # List of available Xcode versions: + # https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode + - name: Setup Xcode version + run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer + + - name: Run iOS Utils Tests working-directory: compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils run: | - xcodebuild test -scheme CMPUIKitUtilsTests -project CMPUIKitUtils.xcodeproj -destination 'platform=iOS Simulator,name=iPhone 16' + xcodebuild test \ + -resultBundlePath TestResults.xcresult \ + -scheme CMPUIKitUtilsTests \ + -project CMPUIKitUtils.xcodeproj \ + -destination 'platform=iOS Simulator,name=iPhone 16' - name: Test Summary - uses: test-summary/action@v2 + uses: kishikawakatsumi/xcresulttool@v1 with: - paths: "out/**/build/test-results/**/TEST-*.xml" + path: "compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils/TestResults.xcresult" if: always() compose-ios-instrumented-tests: @@ -79,14 +109,28 @@ jobs: - name: Setup Prerequisites uses: ./.github/actions/setup-prerequisites + # List of available Xcode versions: + # https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode + - name: Setup Xcode version + run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer + + - name: Building Framework with XCTests + run: | + ./gradlew :compose:ui:ui:linkInstrumentedTestDebugFrameworkUikitSimArm64 + - name: Run iOS Instrumented Tests + working-directory: compose/ui/ui/src/uikitInstrumentedTest/launcher run: | - .jb-ciscripts/PullRequests/UIKitInstrumentedTests.sh + xcodebuild test \ + -resultBundlePath TestResults.xcresult \ + -scheme Launcher-CI \ + -project Launcher.xcodeproj \ + -destination 'platform=iOS Simulator,name=iPhone 16' - name: Test Summary - uses: test-summary/action@v2 + uses: kishikawakatsumi/xcresulttool@v1 with: - paths: "out/**/build/test-results/**/TEST-*.xml" + path: "compose/ui/ui/src/uikitInstrumentedTest/launcher/TestResults.xcresult" if: always() compose-web-chrome-tests: From 3696d84586ced002f4b62c224799ad32d720f4fc Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 18 Sep 2025 18:34:24 +0200 Subject: [PATCH 11/30] Setup Xcode with DerivedData cache --- .github/actions/setup-xcode/action.yml | 20 +++++++++++++++++++ .github/workflows/check-public-api.yml | 3 +++ .github/workflows/compose-publish-dry-run.yml | 3 +++ .github/workflows/compose-tests.yml | 18 ++++++----------- 4 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 .github/actions/setup-xcode/action.yml diff --git a/.github/actions/setup-xcode/action.yml b/.github/actions/setup-xcode/action.yml new file mode 100644 index 0000000000000..22e7791aaa25f --- /dev/null +++ b/.github/actions/setup-xcode/action.yml @@ -0,0 +1,20 @@ +name: 'Setup Xcode' +runs: + using: "composite" + steps: + # List of available Xcode versions: + # https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode + - name: Setup Xcode version + shell: bash + run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer + + - name: Cache Xcode DerivedData + uses: irgaly/xcode-cache@v1 + with: + key: xcode-cache-deriveddata-${{ github.sha }} + restore-keys: xcode-cache-deriveddata- + # Only save DerivedData state for builds on the 'jb-main' branch. + # Builds on other branches will only read existing entries from the cache. + cache-read-only: false + # Replace with this before merging + # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} diff --git a/.github/workflows/check-public-api.yml b/.github/workflows/check-public-api.yml index e4c246e6b1ae9..94c7bf944ec58 100644 --- a/.github/workflows/check-public-api.yml +++ b/.github/workflows/check-public-api.yml @@ -17,6 +17,9 @@ jobs: - name: Setup Prerequisites uses: ./.github/actions/setup-prerequisites + - name: Setup Xcode + uses: ./.github/actions/setup-xcode + - name: Check Public API run: | ./gradlew jbApiCheck \ diff --git a/.github/workflows/compose-publish-dry-run.yml b/.github/workflows/compose-publish-dry-run.yml index b628ef4d1cebf..b08d71a6239aa 100644 --- a/.github/workflows/compose-publish-dry-run.yml +++ b/.github/workflows/compose-publish-dry-run.yml @@ -17,6 +17,9 @@ jobs: - name: Setup Prerequisites uses: ./.github/actions/setup-prerequisites + - name: Setup Xcode + uses: ./.github/actions/setup-xcode + - name: Compose Publish Darwin + Native Linux run: | ./gradlew publishComposeJb -Pcompose.platforms=macos,uikit,tvos,watchos,linux,mingw \ diff --git a/.github/workflows/compose-tests.yml b/.github/workflows/compose-tests.yml index 4877c89237133..b1fc78f41acc9 100644 --- a/.github/workflows/compose-tests.yml +++ b/.github/workflows/compose-tests.yml @@ -53,10 +53,8 @@ jobs: - name: Setup Prerequisites uses: ./.github/actions/setup-prerequisites - # List of available Xcode versions: - # https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode - - name: Setup Xcode version - run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer + - name: Setup Xcode + uses: ./.github/actions/setup-xcode - name: Run iOS Tests run: | @@ -79,10 +77,8 @@ jobs: - name: Setup Prerequisites uses: ./.github/actions/setup-prerequisites - # List of available Xcode versions: - # https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode - - name: Setup Xcode version - run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer + - name: Setup Xcode + uses: ./.github/actions/setup-xcode - name: Run iOS Utils Tests working-directory: compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils @@ -109,10 +105,8 @@ jobs: - name: Setup Prerequisites uses: ./.github/actions/setup-prerequisites - # List of available Xcode versions: - # https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode - - name: Setup Xcode version - run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer + - name: Setup Xcode + uses: ./.github/actions/setup-xcode - name: Building Framework with XCTests run: | From 9183a3899b33c00c597a21ab1b437ad0ec259f31 Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 18 Sep 2025 19:21:05 +0200 Subject: [PATCH 12/30] Report test results via xcpretty --- .github/actions/setup-xcode/action.yml | 4 +++- .github/workflows/compose-tests.yml | 17 ++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/actions/setup-xcode/action.yml b/.github/actions/setup-xcode/action.yml index 22e7791aaa25f..caf160d099a2a 100644 --- a/.github/actions/setup-xcode/action.yml +++ b/.github/actions/setup-xcode/action.yml @@ -6,7 +6,9 @@ runs: # https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode - name: Setup Xcode version shell: bash - run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer + run: | + sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer + /usr/bin/xcodebuild -version - name: Cache Xcode DerivedData uses: irgaly/xcode-cache@v1 diff --git a/.github/workflows/compose-tests.yml b/.github/workflows/compose-tests.yml index b1fc78f41acc9..f72245e5ea211 100644 --- a/.github/workflows/compose-tests.yml +++ b/.github/workflows/compose-tests.yml @@ -81,20 +81,14 @@ jobs: uses: ./.github/actions/setup-xcode - name: Run iOS Utils Tests + 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: Test Summary - uses: kishikawakatsumi/xcresulttool@v1 - with: - path: "compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils/TestResults.xcresult" - if: always() - compose-ios-instrumented-tests: runs-on: macos-15 name: Compose iOS Instrumented Tests @@ -113,18 +107,19 @@ jobs: ./gradlew :compose:ui:ui:linkInstrumentedTestDebugFrameworkUikitSimArm64 - name: Run iOS Instrumented Tests + shell: bash working-directory: compose/ui/ui/src/uikitInstrumentedTest/launcher run: | xcodebuild test \ - -resultBundlePath TestResults.xcresult \ -scheme Launcher-CI \ -project Launcher.xcodeproj \ - -destination 'platform=iOS Simulator,name=iPhone 16' + -destination 'platform=iOS Simulator,name=iPhone 16' \ + | xcpretty --report junit - name: Test Summary - uses: kishikawakatsumi/xcresulttool@v1 + uses: test-summary/action@v2 with: - path: "compose/ui/ui/src/uikitInstrumentedTest/launcher/TestResults.xcresult" + paths: "**/reports/junit.xml" if: always() compose-web-chrome-tests: From 66eeb7265db6f6bffb3b34caf548efafaab5aef5 Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 18 Sep 2025 19:56:59 +0200 Subject: [PATCH 13/30] Try large macOS runners --- .github/workflows/check-public-api.yml | 2 +- .github/workflows/compose-publish-dry-run.yml | 2 +- .github/workflows/compose-tests.yml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check-public-api.yml b/.github/workflows/check-public-api.yml index 94c7bf944ec58..70ed95be95205 100644 --- a/.github/workflows/check-public-api.yml +++ b/.github/workflows/check-public-api.yml @@ -8,7 +8,7 @@ on: jobs: check-public-api: - runs-on: macos-15 + runs-on: macos-15-xlarge name: Check Public API steps: - name: Checkout Repository diff --git a/.github/workflows/compose-publish-dry-run.yml b/.github/workflows/compose-publish-dry-run.yml index b08d71a6239aa..5a07b20539b7e 100644 --- a/.github/workflows/compose-publish-dry-run.yml +++ b/.github/workflows/compose-publish-dry-run.yml @@ -8,7 +8,7 @@ on: jobs: compose-native-publish: - runs-on: macos-15 + runs-on: macos-15-xlarge name: Dry Run Compose Publish Darwin + Native Linux steps: - name: Checkout Repository diff --git a/.github/workflows/compose-tests.yml b/.github/workflows/compose-tests.yml index f72245e5ea211..c68d8cecd2472 100644 --- a/.github/workflows/compose-tests.yml +++ b/.github/workflows/compose-tests.yml @@ -44,7 +44,7 @@ jobs: if: always() compose-ios-tests: - runs-on: macos-15 + runs-on: macos-15-xlarge name: Compose iOS Tests steps: - name: Checkout Repository @@ -68,7 +68,7 @@ jobs: if: always() compose-ios-utils-tests: - runs-on: macos-15 + runs-on: macos-15-xlarge name: Compose iOS Utils Tests steps: - name: Checkout Repository @@ -90,7 +90,7 @@ jobs: -destination 'platform=iOS Simulator,name=iPhone 16' compose-ios-instrumented-tests: - runs-on: macos-15 + runs-on: macos-15-xlarge name: Compose iOS Instrumented Tests steps: - name: Checkout Repository From 284574de2b21563e62c70ec095d267a6579f21b6 Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 18 Sep 2025 20:16:40 +0200 Subject: [PATCH 14/30] Make sure that 18.2 is available on agent --- .github/actions/setup-xcode/action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/actions/setup-xcode/action.yml b/.github/actions/setup-xcode/action.yml index caf160d099a2a..a94d5e2f1dfbc 100644 --- a/.github/actions/setup-xcode/action.yml +++ b/.github/actions/setup-xcode/action.yml @@ -4,10 +4,13 @@ runs: steps: # List of available Xcode versions: # https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode + # Note that explicit download is required due to updated support policy: + # https://github.com/actions/runner-images/issues/12758#issuecomment-3206748945 - name: Setup Xcode version shell: bash run: | sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer + xcodebuild -downloadPlatform iOS -buildVersion 18.2 /usr/bin/xcodebuild -version - name: Cache Xcode DerivedData From 6daa4ee8e1920b5834ef908eb7bdb17969ed4d0b Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 2 Oct 2025 16:27:01 +0200 Subject: [PATCH 15/30] Limit gradle heap to 12g to make it compatiable with 16g agents --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index aea42257f5f53..9345e6d317f77 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -org.gradle.jvmargs=-Xmx16g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -Dkotlin.daemon.jvm.options=-XX:MaxMetaspaceSize=1g -Dlint.nullness.ignore-deprecated=true -Dorg.gradle.configuration-cache.internal.load-after-store=false +org.gradle.jvmargs=-Xmx12g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -Dkotlin.daemon.jvm.options=-XX:MaxMetaspaceSize=1g -Dlint.nullness.ignore-deprecated=true -Dorg.gradle.configuration-cache.internal.load-after-store=false org.gradle.daemon=true org.gradle.configureondemand=true org.gradle.parallel=true From 5fccaab1f9bbd24b9e0df68a6378881005888c68 Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 18 Sep 2025 20:37:50 +0200 Subject: [PATCH 16/30] Write caches only from jb-main --- .github/actions/setup-prerequisites/action.yml | 4 +--- .github/actions/setup-xcode/action.yml | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup-prerequisites/action.yml b/.github/actions/setup-prerequisites/action.yml index 3949b9ca5a642..2a6c334f8d11f 100644 --- a/.github/actions/setup-prerequisites/action.yml +++ b/.github/actions/setup-prerequisites/action.yml @@ -16,9 +16,7 @@ runs: with: # Only save Gradle User Home state for builds on the 'jb-main' branch. # Builds on other branches will only read existing entries from the cache. - cache-read-only: false - # Replace with this before merging - # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} + cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} # Limit the size of the cache entry. # These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly. diff --git a/.github/actions/setup-xcode/action.yml b/.github/actions/setup-xcode/action.yml index a94d5e2f1dfbc..90b449317d14f 100644 --- a/.github/actions/setup-xcode/action.yml +++ b/.github/actions/setup-xcode/action.yml @@ -20,6 +20,4 @@ runs: restore-keys: xcode-cache-deriveddata- # Only save DerivedData state for builds on the 'jb-main' branch. # Builds on other branches will only read existing entries from the cache. - cache-read-only: false - # Replace with this before merging - # cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} + cache-read-only: ${{ github.ref != 'refs/heads/jb-main' }} From 4a227ed4300bb1ffda59b5630cc85673d620f98d Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Tue, 30 Sep 2025 16:18:43 +0200 Subject: [PATCH 17/30] Fail desktop test, change code --- .../androidx/compose/ui/awt/ComposeWindow.desktop.kt | 8 ++++---- .../kotlin/androidx/compose/ui/awt/ComposeFocusTest.kt | 2 +- .../kotlin/androidx/compose/ui/awt/ComposeWindowTest.kt | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeWindow.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeWindow.desktop.kt index 633e28e537508..fc58c8e3ff711 100644 --- a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeWindow.desktop.kt +++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeWindow.desktop.kt @@ -49,12 +49,12 @@ import org.jetbrains.skiko.SkiaLayerAnalytics * @param skiaLayerAnalytics Analytics that helps to know more about SkiaLayer behaviour. * SkiaLayer is underlying class used internally to draw Compose content. * Implementation usually uses third-party solution to send info to some centralized analytics gatherer. - * @param savedState The saved state to restore the UI state from a previous instance. + * @param savedState2 The saved state to restore the UI state from a previous instance. */ class ComposeWindow @ExperimentalComposeUiApi constructor( graphicsConfiguration: GraphicsConfiguration? = null, skiaLayerAnalytics: SkiaLayerAnalytics = SkiaLayerAnalytics.Empty, - savedState: SavedState? = null, + savedState2: SavedState? = null, ) : JFrame(graphicsConfiguration) { /** * ComposeWindow is a window for building UI using Compose for Desktop. @@ -71,7 +71,7 @@ class ComposeWindow @ExperimentalComposeUiApi constructor( window = this, isUndecorated = ::isUndecorated, skiaLayerAnalytics = skiaLayerAnalytics, - savedState = savedState, + savedState = savedState2, ) private val undecoratedWindowResizer = UndecoratedWindowResizer(this) @@ -184,7 +184,7 @@ class ComposeWindow @ExperimentalComposeUiApi constructor( /** * Saves the current UI state into a [SavedState] object. The returned state can be used - * to restore the UI state later by passing it to the constructor's [savedState] parameter. + * to restore the UI state later by passing it to the constructor's [savedState2] parameter. * * @return A [SavedState] object containing the current UI state. */ diff --git a/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/awt/ComposeFocusTest.kt b/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/awt/ComposeFocusTest.kt index 813dfab4e1eee..67a2d71ae37dc 100644 --- a/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/awt/ComposeFocusTest.kt +++ b/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/awt/ComposeFocusTest.kt @@ -76,7 +76,7 @@ class ComposeFocusTest { window.isVisible = true testRandomFocus( - composeButton1, composeButton2, composeButton3, composeButton4 + composeButton1, composeButton3, composeButton2, composeButton4 ) } diff --git a/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/awt/ComposeWindowTest.kt b/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/awt/ComposeWindowTest.kt index c62629235f93e..26d209c1980a3 100644 --- a/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/awt/ComposeWindowTest.kt +++ b/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/awt/ComposeWindowTest.kt @@ -314,7 +314,7 @@ class ComposeWindowTest { } suspend fun testWindow(savedState: SavedState? = null, verify: (ComposeWindow) -> Unit) { - val window = ComposeWindow(savedState = savedState) + val window = ComposeWindow(savedState2 = savedState) try { window.setContent { testContent() } window.isVisible = true From b8ca2f893affd41c7c955103e2c437cad53def61 Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Tue, 30 Sep 2025 16:19:24 +0200 Subject: [PATCH 18/30] Change code --- .../src/commonMain/kotlin/androidx/compose/ui/draw/Alpha.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/draw/Alpha.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/draw/Alpha.kt index c04593bca90cc..27f0e7a318cca 100644 --- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/draw/Alpha.kt +++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/draw/Alpha.kt @@ -29,7 +29,7 @@ import androidx.compose.ui.graphics.graphicsLayer * the destination with the desired alpha. This layer is sized to the bounds of the composable this * modifier is configured on, and contents outside of these bounds are omitted. * - * @param alpha the fraction of children's alpha value and must be between `0` and `1`, inclusive. + * @param alpha2 the fraction of children's alpha value and must be between `0` and `1`, inclusive. * @sample androidx.compose.ui.samples.AlphaSample * @see graphicsLayer * @@ -38,5 +38,5 @@ import androidx.compose.ui.graphics.graphicsLayer @Stable fun Modifier.alpha( /*@FloatRange(from = 0.0, to = 1.0)*/ - alpha: Float -) = if (alpha != 1.0f) graphicsLayer(alpha = alpha, clip = true) else this + alpha2: Float +) = if (alpha2 != 1.0f) graphicsLayer(alpha = alpha2, clip = true) else this From 360052840752ff8921b19e5f65b5b70d73f1a5bd Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Tue, 30 Sep 2025 16:20:07 +0200 Subject: [PATCH 19/30] Fail web test --- .../kotlin/androidx/compose/ui/SelectionContainerTests.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose/ui/ui/src/webTest/kotlin/androidx/compose/ui/SelectionContainerTests.kt b/compose/ui/ui/src/webTest/kotlin/androidx/compose/ui/SelectionContainerTests.kt index 795f189f6be17..7c6469fdffa0b 100644 --- a/compose/ui/ui/src/webTest/kotlin/androidx/compose/ui/SelectionContainerTests.kt +++ b/compose/ui/ui/src/webTest/kotlin/androidx/compose/ui/SelectionContainerTests.kt @@ -110,7 +110,7 @@ class SelectionContainerTests : OnCanvasTests { // reset selection by clicking canvas.doClick() selection = syncChannel.receive() - assertFalse(selection.exists()) + assertTrue(selection.exists()) } @Test From 4a20ab3e3b8eb5b1249b2f22058dca37693b3b00 Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Tue, 30 Sep 2025 16:20:24 +0200 Subject: [PATCH 20/30] Fail iOS test --- .../kotlin/androidx/compose/ui/window/FocusedViewsListTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose/ui/ui/src/uikitTest/kotlin/androidx/compose/ui/window/FocusedViewsListTest.kt b/compose/ui/ui/src/uikitTest/kotlin/androidx/compose/ui/window/FocusedViewsListTest.kt index a5830164450bf..5b2843af36514 100644 --- a/compose/ui/ui/src/uikitTest/kotlin/androidx/compose/ui/window/FocusedViewsListTest.kt +++ b/compose/ui/ui/src/uikitTest/kotlin/androidx/compose/ui/window/FocusedViewsListTest.kt @@ -87,7 +87,7 @@ class FocusedViewsListTest { assertTrue(view3.isFirstResponder()) list.remove(view3, delayMillis = 50) - assertTrue(view3.isFirstResponder()) + assertFalse(view3.isFirstResponder()) performRunLoopCycle(delayMills = 200) assertTrue(view2.isFirstResponder()) From 801f0ce283c9a755f55c903c5008be0508fa2a61 Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Tue, 30 Sep 2025 16:21:03 +0200 Subject: [PATCH 21/30] Fail iOS instrumented test --- .../kotlin/androidx/compose/ui/modifiers/FrameRateTest.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compose/ui/ui/src/uikitInstrumentedTest/kotlin/androidx/compose/ui/modifiers/FrameRateTest.kt b/compose/ui/ui/src/uikitInstrumentedTest/kotlin/androidx/compose/ui/modifiers/FrameRateTest.kt index aaccc840b7bac..f75d704c770a2 100644 --- a/compose/ui/ui/src/uikitInstrumentedTest/kotlin/androidx/compose/ui/modifiers/FrameRateTest.kt +++ b/compose/ui/ui/src/uikitInstrumentedTest/kotlin/androidx/compose/ui/modifiers/FrameRateTest.kt @@ -47,6 +47,7 @@ import kotlin.math.abs import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNotNull +import kotlin.test.assertNull import kotlin.test.fail import kotlinx.coroutines.launch import platform.QuartzCore.CADisplayLink @@ -66,13 +67,13 @@ internal class FrameRateTest { } val redrawer = hostingViewController.rootViewRedrawer - assertNotNull(redrawer, "redrawer is null") + assertNull(redrawer, "redrawer is null") for (frameRate in frameRates) { val expectedFrameDuration = 1.0 / frameRate findNodeWithTag("${frameRate}fps").tap() waitUntil { - val frameDuration = redrawer.currentTargetFrameDuration + val frameDuration = redrawer!!.currentTargetFrameDuration assertNotNull(frameDuration) checkEqual(expectedFrameDuration, frameDuration, 1e-5) } From 00a6bbcda2803e3501f631ffaa5dd8ac7305c9b9 Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 2 Oct 2025 17:43:02 +0200 Subject: [PATCH 22/30] Remove androidx.ignoreTestFailures flag --- .github/workflows/compose-tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/compose-tests.yml b/.github/workflows/compose-tests.yml index c68d8cecd2472..024f58a8023cb 100644 --- a/.github/workflows/compose-tests.yml +++ b/.github/workflows/compose-tests.yml @@ -25,8 +25,7 @@ jobs: - name: Run Desktop Tests run: | ./gradlew testDesktop \ - --no-daemon --stacktrace \ - -Pandroidx.ignoreTestFailures + --no-daemon --stacktrace - name: Upload Screenshots uses: actions/upload-artifact@v4 From aad936429fdac637a7d327b2b1fb96d30e197631 Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 2 Oct 2025 17:43:02 +0200 Subject: [PATCH 23/30] Remove androidx.ignoreTestFailures flag --- .github/workflows/compose-tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/compose-tests.yml b/.github/workflows/compose-tests.yml index c68d8cecd2472..024f58a8023cb 100644 --- a/.github/workflows/compose-tests.yml +++ b/.github/workflows/compose-tests.yml @@ -25,8 +25,7 @@ jobs: - name: Run Desktop Tests run: | ./gradlew testDesktop \ - --no-daemon --stacktrace \ - -Pandroidx.ignoreTestFailures + --no-daemon --stacktrace - name: Upload Screenshots uses: actions/upload-artifact@v4 From 8aeafc7bae253bc7df5229f4c24b1cbca12f65a6 Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 2 Oct 2025 18:31:43 +0200 Subject: [PATCH 24/30] Ignore one more flaky test --- .../kotlin/androidx/compose/ui/window/window/WindowTest.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/window/window/WindowTest.kt b/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/window/window/WindowTest.kt index 3f5b8164ed85a..ddf60963473ba 100644 --- a/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/window/window/WindowTest.kt +++ b/compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/window/window/WindowTest.kt @@ -588,6 +588,7 @@ class WindowTest { assertThat(isWindowEffectEnded).isTrue() } + @Ignore("flaky") // TODO https://youtrack.jetbrains.com/issue/CMP-8957 @Test fun `undecorated resizable window with unspecified size`() = runApplicationTest( useDelay = true From 4bef28648d54e5a7201189c14691fa080f29a3ff Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Fri, 3 Oct 2025 13:27:55 +0200 Subject: [PATCH 25/30] Update BaseComposeScene.skiko.kt --- .../kotlin/androidx/compose/ui/scene/BaseComposeScene.skiko.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/scene/BaseComposeScene.skiko.kt b/compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/scene/BaseComposeScene.skiko.kt index 884a552e608df..2e77439a61740 100644 --- a/compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/scene/BaseComposeScene.skiko.kt +++ b/compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/scene/BaseComposeScene.skiko.kt @@ -135,6 +135,7 @@ internal abstract class BaseComposeScene( override fun hasInvalidations(): Boolean = hasPendingDraws || recomposer.hasPendingWork + fun test(): Boolean = true override fun setContent(content: @Composable () -> Unit) = postponeInvalidation("BaseComposeScene:setContent") { check(!isClosed) { "setContent called after ComposeScene is closed" } From 74e1e64c0eddc30e81e286f9395ea21672ffe52f Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Fri, 3 Oct 2025 13:48:24 +0200 Subject: [PATCH 26/30] Update CMPViewControllerTests.swift --- .../CMPUIKitUtilsTests/CMPViewControllerTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils/CMPUIKitUtilsTests/CMPViewControllerTests.swift b/compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils/CMPUIKitUtilsTests/CMPViewControllerTests.swift index f2b640d6feecc..cde97782fd308 100644 --- a/compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils/CMPUIKitUtilsTests/CMPViewControllerTests.swift +++ b/compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils/CMPUIKitUtilsTests/CMPViewControllerTests.swift @@ -105,7 +105,7 @@ final class CMPViewControllerTests: XCTestCase { rootViewController.dismiss(animated: true) - await expect(viewController: viewController, toBeInHierarchy: false) + await expect(viewController: viewController, toBeInHierarchy: true) } @MainActor From 8985687b316d2d567fc72f2caa1f82a31f1689af Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Fri, 3 Oct 2025 13:49:38 +0200 Subject: [PATCH 27/30] Update ComposeScene.skiko.kt --- .../kotlin/androidx/compose/ui/scene/ComposeScene.skiko.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/scene/ComposeScene.skiko.kt b/compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/scene/ComposeScene.skiko.kt index b044c6ce2b455..40573604ef4cc 100644 --- a/compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/scene/ComposeScene.skiko.kt +++ b/compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/scene/ComposeScene.skiko.kt @@ -57,6 +57,8 @@ import androidx.compose.ui.viewinterop.pointerInteropFilter @Deprecated("Use LocalComposeSceneContext instead") internal val LocalComposeScene = staticCompositionLocalOf { null } +val LocalTest = staticCompositionLocalOf { null } + /** * A virtual container that encapsulates Compose UI content. UI content can be constructed via * [setContent] method and with any Composable that manipulates [LayoutNode] tree. From 85f283b1c8bd64aa5b117fe9b5c058a5a20df8a3 Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Fri, 3 Oct 2025 14:32:48 +0200 Subject: [PATCH 28/30] CMPViewControllerTests --- .../CMPUIKitUtilsTests/CMPViewControllerTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils/CMPUIKitUtilsTests/CMPViewControllerTests.swift b/compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils/CMPUIKitUtilsTests/CMPViewControllerTests.swift index cde97782fd308..f2b640d6feecc 100644 --- a/compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils/CMPUIKitUtilsTests/CMPViewControllerTests.swift +++ b/compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils/CMPUIKitUtilsTests/CMPViewControllerTests.swift @@ -105,7 +105,7 @@ final class CMPViewControllerTests: XCTestCase { rootViewController.dismiss(animated: true) - await expect(viewController: viewController, toBeInHierarchy: true) + await expect(viewController: viewController, toBeInHierarchy: false) } @MainActor From 15dbd57ef03c66062fba02a17bfce514a4de88a9 Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Fri, 3 Oct 2025 14:33:36 +0200 Subject: [PATCH 29/30] CMPViewControllerTests --- .../CMPUIKitUtilsTests/CMPViewControllerTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils/CMPUIKitUtilsTests/CMPViewControllerTests.swift b/compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils/CMPUIKitUtilsTests/CMPViewControllerTests.swift index f2b640d6feecc..f949c881b639f 100644 --- a/compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils/CMPUIKitUtilsTests/CMPViewControllerTests.swift +++ b/compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils/CMPUIKitUtilsTests/CMPViewControllerTests.swift @@ -358,7 +358,7 @@ private class TestViewController: CMPViewController { override func viewControllerDidEnterWindowHierarchy() { super.viewControllerDidEnterWindowHierarchy() print("TestViewController_\(id) didEnterWindowHierarchy") - XCTAssertFalse(viewIsInWindowHierarchy) + XCTAssertTrue(viewIsInWindowHierarchy) viewIsInWindowHierarchy = true } From f72ea78cc469f7fb36308834294364fd400d0327 Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Fri, 3 Oct 2025 14:45:21 +0200 Subject: [PATCH 30/30] Update SelectionContainerTests.kt --- .../kotlin/androidx/compose/ui/SelectionContainerTests.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compose/ui/ui/src/webTest/kotlin/androidx/compose/ui/SelectionContainerTests.kt b/compose/ui/ui/src/webTest/kotlin/androidx/compose/ui/SelectionContainerTests.kt index 7c6469fdffa0b..7ab0fa0ce9a9f 100644 --- a/compose/ui/ui/src/webTest/kotlin/androidx/compose/ui/SelectionContainerTests.kt +++ b/compose/ui/ui/src/webTest/kotlin/androidx/compose/ui/SelectionContainerTests.kt @@ -110,7 +110,8 @@ class SelectionContainerTests : OnCanvasTests { // reset selection by clicking canvas.doClick() selection = syncChannel.receive() - assertTrue(selection.exists()) + assertFalse(selection.exists()) + } @Test