Skip to content

Commit b3af5a4

Browse files
committed
Change Tests workflow
1 parent ee89935 commit b3af5a4

1 file changed

Lines changed: 82 additions & 3 deletions

File tree

.github/workflows/compose-tests.yml

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,38 @@ on:
88
- integration
99

1010
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/**'
1143
# TODO: https://youtrack.jetbrains.com/issue/CMP-9497/Investgate-CfW-tests-flakiness-with-enabled-gradle-configuration-cache-on-CI
1244
# Web Tests require running additional processes: karma in node, browser;
1345
# To reduce the memory pressure, we change some defaults:
@@ -17,20 +49,56 @@ env:
1749
-Porg.gradle.workers.max=1
1850
1951
jobs:
20-
compose-desktop-tests:
52+
changes:
2153
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 }}
2359
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+
2490
- name: Checkout Repository
2591
uses: actions/checkout@v5
2692

2793
- name: Setup Prerequisites
2894
uses: ./.github/actions/setup-prerequisites
2995

3096
- name: Setup Window Manager
97+
if: runner.os == 'Linux'
3198
run: sudo apt-get update && sudo apt-get install -y xvfb openbox x11-utils
3299

33100
- name: Start X Server
101+
if: runner.os == 'Linux'
34102
run: |
35103
sudo Xvfb :1 -screen 0 1920x1080x24 -extension RANDR +extension GLX &
36104
export DISPLAY=:1
@@ -40,6 +108,7 @@ jobs:
40108
echo "DISPLAY=:1.0" >> $GITHUB_ENV
41109
42110
- name: Run Desktop
111+
shell: bash
43112
run: |
44113
./gradlew testDesktop \
45114
--no-daemon --stacktrace
@@ -48,7 +117,7 @@ jobs:
48117
uses: actions/upload-artifact@v4
49118
if: failure()
50119
with:
51-
name: screenshot-tests
120+
name: screenshot-tests-${{ matrix.name }}
52121
path: |
53122
golden/**/*_actual.png
54123
golden/**/*_diff.png
@@ -60,6 +129,8 @@ jobs:
60129
if: always()
61130

62131
compose-ios-tests:
132+
needs: changes
133+
if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.ios == 'true' || needs.changes.outputs.unknown == 'true'
63134
runs-on: macos-26-xlarge
64135
name: iOS
65136
env:
@@ -87,6 +158,8 @@ jobs:
87158
if: always()
88159

89160
compose-ios-utils-tests:
161+
needs: changes
162+
if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.ios == 'true' || needs.changes.outputs.unknown == 'true'
90163
runs-on: macos-26-xlarge
91164
name: iOS Utils
92165
env:
@@ -120,6 +193,8 @@ jobs:
120193
path: compose/ui/ui-uikit/src/iosMain/objc/CMPUIKitUtils/TestResults.xcresult
121194

122195
compose-ios-instrumented-tests:
196+
needs: changes
197+
if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.ios == 'true' || needs.changes.outputs.unknown == 'true'
123198
runs-on: ${{ matrix.runner }}
124199
strategy:
125200
fail-fast: false
@@ -197,6 +272,8 @@ jobs:
197272
if: always()
198273

199274
compose-web-chrome-tests:
275+
needs: changes
276+
if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.web == 'true' || needs.changes.outputs.unknown == 'true'
200277
runs-on: ubuntu-24.04
201278
name: Web Chrome
202279
strategy:
@@ -289,6 +366,8 @@ jobs:
289366
if: always()
290367

291368
compose-web-firefox-tests:
369+
needs: changes
370+
if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.web == 'true' || needs.changes.outputs.unknown == 'true'
292371
runs-on: ubuntu-24.04
293372
name: Web Firefox
294373
strategy:

0 commit comments

Comments
 (0)