jewel migration #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: UI Tests | |
| on: | |
| pull_request: | |
| branches: [ "main" ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| ui-test: | |
| strategy: | |
| # Keep running the other platforms even if one fails so we get full signal | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| # Linux runners have no display server; start a virtual one before launching the IDE. | |
| - name: Start virtual display (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get install -y xvfb | |
| Xvfb :99 -screen 0 1920x1080x24 & | |
| echo "DISPLAY=:99" >> "$GITHUB_ENV" | |
| # Start the IDE in the background. The task blocks until the IDE exits, so we | |
| # deliberately background it and let GitHub Actions clean it up at job end. | |
| - name: Start IDE with robot server | |
| run: ./gradlew runIdeForUiTests & | |
| shell: bash | |
| env: | |
| DISPLAY: ${{ env.DISPLAY }} | |
| # Poll the robot server TCP port until it accepts connections, or fail after 5 minutes. | |
| # The robot server has no GET health endpoint; nc is the reliable way to probe the port. | |
| - name: Wait for robot server to be ready | |
| run: | | |
| echo "Waiting for robot server on port 8082..." | |
| MAX_WAIT=60 | |
| ATTEMPT=0 | |
| until nc -z localhost 8082 2>/dev/null; do | |
| ATTEMPT=$((ATTEMPT + 1)) | |
| if [ "$ATTEMPT" -ge "$MAX_WAIT" ]; then | |
| echo "ERROR: robot server did not start after $((MAX_WAIT * 5)) seconds" | |
| exit 1 | |
| fi | |
| echo "Attempt $ATTEMPT/$MAX_WAIT — not ready yet, retrying in 5s..." | |
| sleep 5 | |
| done | |
| echo "Robot server is ready!" | |
| shell: bash | |
| - name: Clean up test module (pre-test) | |
| run: rm -rf src/uiTest/testProject/repository | |
| shell: bash | |
| - name: Run UI tests | |
| run: ./gradlew uiTest | |
| env: | |
| DISPLAY: ${{ env.DISPLAY }} | |
| - name: Clean up test module (post-test) | |
| if: always() | |
| run: | | |
| rm -rf src/uiTest/testProject/repository | |
| git checkout -- src/uiTest/testProject/settings.gradle.kts | |
| shell: bash | |
| - name: Upload test report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ui-test-results-${{ matrix.os }} | |
| path: build/reports/tests/uiTest/ | |
| if-no-files-found: ignore | |
| # Upload IDE logs to help diagnose failures | |
| - name: Upload IDE logs on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ide-logs-${{ matrix.os }} | |
| path: build/idea-sandbox/system/log/ | |
| if-no-files-found: ignore |