|
8 | 8 | - integration |
9 | 9 |
|
10 | 10 | env: |
| 11 | + PLATFORM_PATH_FILTERS: | |
| 12 | + ios: |
| 13 | + - '**/iosMain/**' |
| 14 | + - '**/darwinMain/**' |
| 15 | + - '**/nativeMain/**' |
| 16 | + - '**/uikitMain/**' |
| 17 | + |
| 18 | + web: |
| 19 | + - '**/webMain/**' |
| 20 | + - '**/jsMain/**' |
| 21 | + - '**/jsWasmMain/**' |
| 22 | + - '**/wasmJsMain/**' |
| 23 | + |
| 24 | + desktop: |
| 25 | + - '**/jvmMain/**' |
| 26 | + - '**/desktopMain/**' |
| 27 | + |
| 28 | + unknown: |
| 29 | + - '**' |
| 30 | + |
| 31 | + - '!**/iosMain/**' |
| 32 | + - '!**/darwinMain/**' |
| 33 | + - '!**/nativeMain/**' |
| 34 | + - '!**/uikitMain/**' |
| 35 | + |
| 36 | + - '!**/webMain/**' |
| 37 | + - '!**/jsMain/**' |
| 38 | + - '!**/jsWasmMain/**' |
| 39 | + - '!**/wasmJsMain/**' |
| 40 | + |
| 41 | + - '!**/jvmMain/**' |
| 42 | + - '!**/desktopMain/**' |
11 | 43 | # TODO: https://youtrack.jetbrains.com/issue/CMP-9497/Investgate-CfW-tests-flakiness-with-enabled-gradle-configuration-cache-on-CI |
12 | 44 | # Web Tests require running additional processes: karma in node, browser; |
13 | 45 | # To reduce the memory pressure, we change some defaults: |
|
17 | 49 | -Porg.gradle.workers.max=1 |
18 | 50 |
|
19 | 51 | jobs: |
20 | | - compose-desktop-tests: |
| 52 | + changes: |
21 | 53 | runs-on: ubuntu-24.04 |
22 | | - name: Desktop |
| 54 | + outputs: |
| 55 | + ios: ${{ steps.filter.outputs.ios }} |
| 56 | + web: ${{ steps.filter.outputs.web }} |
| 57 | + desktop: ${{ steps.filter.outputs.desktop }} |
| 58 | + unknown: ${{ steps.filter.outputs.unknown }} |
23 | 59 | steps: |
| 60 | + - uses: actions/checkout@v5 |
| 61 | + |
| 62 | + - name: Detect affected platforms |
| 63 | + id: filter |
| 64 | + uses: dorny/paths-filter@v4 |
| 65 | + with: |
| 66 | + filters: ${{ env.PLATFORM_PATH_FILTERS }} |
| 67 | + predicate-quantifier: some-with-excludes |
| 68 | + |
| 69 | + compose-desktop-tests: |
| 70 | + needs: changes |
| 71 | + if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.desktop == 'true' || needs.changes.outputs.unknown == 'true' |
| 72 | + runs-on: ${{ matrix.runner }} |
| 73 | + name: Desktop (${{ matrix.name }}) |
| 74 | + strategy: |
| 75 | + fail-fast: false |
| 76 | + matrix: |
| 77 | + include: |
| 78 | + - name: Linux |
| 79 | + runner: ubuntu-24.04 |
| 80 | + - name: Windows |
| 81 | + runner: windows-2025 |
| 82 | + - name: macOS |
| 83 | + runner: macos-26 |
| 84 | + steps: |
| 85 | + - name: Enable Git Long Paths |
| 86 | + if: runner.os == 'Windows' |
| 87 | + shell: pwsh |
| 88 | + run: git config --global core.longpaths true |
| 89 | + |
24 | 90 | - name: Checkout Repository |
25 | 91 | uses: actions/checkout@v5 |
26 | 92 |
|
27 | 93 | - name: Setup Prerequisites |
28 | 94 | uses: ./.github/actions/setup-prerequisites |
29 | 95 |
|
30 | 96 | - name: Setup Window Manager |
| 97 | + if: runner.os == 'Linux' |
31 | 98 | run: sudo apt-get update && sudo apt-get install -y xvfb openbox x11-utils |
32 | 99 |
|
33 | 100 | - name: Start X Server |
| 101 | + if: runner.os == 'Linux' |
34 | 102 | run: | |
35 | 103 | sudo Xvfb :1 -screen 0 1920x1080x24 -extension RANDR +extension GLX & |
36 | 104 | export DISPLAY=:1 |
|
40 | 108 | echo "DISPLAY=:1.0" >> $GITHUB_ENV |
41 | 109 |
|
42 | 110 | - name: Run Desktop |
| 111 | + shell: bash |
43 | 112 | run: | |
44 | 113 | ./gradlew testDesktop \ |
45 | 114 | --no-daemon --stacktrace |
|
48 | 117 | uses: actions/upload-artifact@v4 |
49 | 118 | if: failure() |
50 | 119 | with: |
51 | | - name: screenshot-tests |
| 120 | + name: screenshot-tests-${{ matrix.name }} |
52 | 121 | path: | |
53 | 122 | golden/**/*_actual.png |
54 | 123 | golden/**/*_diff.png |
|
60 | 129 | if: always() |
61 | 130 |
|
62 | 131 | compose-ios-tests: |
| 132 | + needs: changes |
| 133 | + if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.ios == 'true' || needs.changes.outputs.unknown == 'true' |
63 | 134 | runs-on: macos-26-xlarge |
64 | 135 | name: iOS |
65 | 136 | env: |
|
87 | 158 | if: always() |
88 | 159 |
|
89 | 160 | compose-ios-utils-tests: |
| 161 | + needs: changes |
| 162 | + if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.ios == 'true' || needs.changes.outputs.unknown == 'true' |
90 | 163 | runs-on: macos-26-xlarge |
91 | 164 | name: iOS Utils |
92 | 165 | env: |
@@ -120,6 +193,8 @@ jobs: |
120 | 193 | path: compose/ui/ui-uikit/src/iosMain/objc/CMPUIKitUtils/TestResults.xcresult |
121 | 194 |
|
122 | 195 | compose-ios-instrumented-tests: |
| 196 | + needs: changes |
| 197 | + if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.ios == 'true' || needs.changes.outputs.unknown == 'true' |
123 | 198 | runs-on: ${{ matrix.runner }} |
124 | 199 | strategy: |
125 | 200 | fail-fast: false |
@@ -197,6 +272,8 @@ jobs: |
197 | 272 | if: always() |
198 | 273 |
|
199 | 274 | compose-web-chrome-tests: |
| 275 | + needs: changes |
| 276 | + if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.web == 'true' || needs.changes.outputs.unknown == 'true' |
200 | 277 | runs-on: ubuntu-24.04 |
201 | 278 | name: Web Chrome |
202 | 279 | strategy: |
@@ -289,6 +366,8 @@ jobs: |
289 | 366 | if: always() |
290 | 367 |
|
291 | 368 | compose-web-firefox-tests: |
| 369 | + needs: changes |
| 370 | + if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.web == 'true' || needs.changes.outputs.unknown == 'true' |
292 | 371 | runs-on: ubuntu-24.04 |
293 | 372 | name: Web Firefox |
294 | 373 | strategy: |
|
0 commit comments