@@ -138,17 +138,22 @@ jobs:
138138 fi
139139
140140 build :
141- name : Build on Java ${{ matrix.java-version }}
141+ name : Build on ${{ matrix.os }}
142142 needs : validate-inputs
143143 if : ${{ always() && (needs.validate-inputs.result == 'success' || needs.validate-inputs.result == 'skipped') }}
144- runs-on : macos-latest
144+ runs-on : ${{ matrix.os }}
145145 timeout-minutes : 20
146146
147147 strategy :
148148 fail-fast : false
149149 matrix :
150+ os : [ubuntu-latest, macos-latest, windows-latest]
150151 java-version : [17]
151152
153+ defaults :
154+ run :
155+ shell : bash
156+
152157 steps :
153158 - name : Clone repository
154159 uses : actions/checkout@v6
@@ -161,19 +166,21 @@ jobs:
161166 cache : gradle
162167
163168 - name : Build xctest-runner
169+ if : runner.os == 'macOS'
164170 run : ./maestro-ios-xctest-runner/build-maestro-ios-runner.sh | xcbeautify
165171
166172 - name : Build Maestro CLI
167173 run : ./gradlew :maestro-cli:distZip
168174
169- - name : Upload zipped Maestro CLI artifact
175+ - name : Upload Maestro CLI artifact
170176 uses : actions/upload-artifact@v7
171177 with :
172- name : maestro-cli-jdk${{ matrix.java-version }}-run_id${{ github.run_id }}
178+ name : maestro-cli-${{ matrix.os }}- jdk${{ matrix.java-version }}-run_id${{ github.run_id }}
173179 path : maestro-cli/build/distributions/maestro.zip
174180 retention-days : 1
175181
176182 - name : Upload build/Products to artifacts
183+ if : runner.os == 'macOS'
177184 uses : actions/upload-artifact@v7
178185 with :
179186 name : build__Products-jdk${{ matrix.java-version }}
@@ -208,7 +215,7 @@ jobs:
208215 - name : Download artifacts
209216 uses : actions/download-artifact@v8
210217 with :
211- name : maestro-cli-jdk17-run_id${{ github.run_id }}
218+ name : maestro-cli-macos-latest- jdk17-run_id${{ github.run_id }}
212219
213220 - name : Add Maestro CLI executable to PATH
214221 run : |
@@ -324,7 +331,7 @@ jobs:
324331 - name : Download Maestro build from previous job
325332 uses : actions/download-artifact@v8
326333 with :
327- name : maestro-cli-jdk17-run_id${{ github.run_id }}
334+ name : maestro-cli-macos-latest- jdk17-run_id${{ github.run_id }}
328335
329336 - name : Add Maestro CLI executable to PATH
330337 run : |
@@ -435,7 +442,7 @@ jobs:
435442 - name : Download artifacts
436443 uses : actions/download-artifact@v8
437444 with :
438- name : maestro-cli-jdk17-run_id${{ github.run_id }}
445+ name : maestro-cli-macos-latest- jdk17-run_id${{ github.run_id }}
439446
440447 - name : Add Maestro CLI executable to PATH
441448 run : |
@@ -527,7 +534,7 @@ jobs:
527534 - name : Download Maestro artifact
528535 uses : actions/download-artifact@v8
529536 with :
530- name : maestro-cli-jdk17-run_id${{ github.run_id }}
537+ name : maestro-cli-macos-latest- jdk17-run_id${{ github.run_id }}
531538
532539 - name : Download build/Products artifact
533540 uses : actions/download-artifact@v8
@@ -560,3 +567,57 @@ jobs:
560567 path : ~/Library/Logs/maestro/xctest_runner_logs
561568 retention-days : 7
562569 include-hidden-files : true
570+
571+ test-cli :
572+ name : Verify CLI version on ${{ matrix.os }}
573+ runs-on : ${{ matrix.os }}
574+ needs : build
575+ if : ${{ always() && needs.build.result == 'success' }}
576+ timeout-minutes : 10
577+
578+ strategy :
579+ fail-fast : false
580+ matrix :
581+ os : [ubuntu-latest, macos-latest, windows-latest]
582+ java-version : [17]
583+
584+ defaults :
585+ run :
586+ shell : bash
587+
588+ steps :
589+ - name : Clone repository
590+ uses : actions/checkout@v6
591+
592+ - name : Set up Java
593+ uses : actions/setup-java@v5
594+ with :
595+ distribution : zulu
596+ java-version : ${{ matrix.java-version }}
597+
598+ - name : Download Maestro CLI artifact
599+ uses : actions/download-artifact@v8
600+ with :
601+ name : maestro-cli-${{ matrix.os }}-jdk${{ matrix.java-version }}-run_id${{ github.run_id }}
602+
603+ - name : Add Maestro CLI to PATH (Linux / macOS)
604+ if : runner.os != 'Windows'
605+ run : |
606+ unzip maestro.zip -d maestro_extracted
607+ echo "$PWD/maestro_extracted/maestro/bin" >> $GITHUB_PATH
608+
609+ - name : Add Maestro CLI to PATH (Windows)
610+ if : runner.os == 'Windows'
611+ shell : pwsh
612+ run : |
613+ Expand-Archive -Path maestro.zip -DestinationPath maestro_extracted
614+ "$PWD\maestro_extracted\maestro\bin" | Out-File -FilePath $env:GITHUB_PATH -Append
615+
616+ - name : Test CLI (Linux / macOS)
617+ if : runner.os != 'Windows'
618+ run : e2e/cli/test-cli.sh
619+
620+ - name : Test CLI (Windows)
621+ if : runner.os == 'Windows'
622+ shell : pwsh
623+ run : e2e/cli/test-cli.ps1
0 commit comments