diff --git a/.github/workflows/e2e-autotest.yml b/.github/workflows/e2e-autotest.yml index 82e08d9c..db4d2998 100644 --- a/.github/workflows/e2e-autotest.yml +++ b/.github/workflows/e2e-autotest.yml @@ -88,11 +88,12 @@ jobs: needs: [discover, build-pack] # build-pack is skipped on schedule/workflow_dispatch — only require it on PRs if: ${{ always() && needs.discover.result == 'success' && (github.event_name != 'pull_request' || needs.build-pack.result == 'success') }} - runs-on: windows-latest + runs-on: ${{ matrix.os }} timeout-minutes: 30 strategy: fail-fast: false matrix: + os: [windows-latest, ubuntu-latest, macos-latest] plan: ${{ fromJson(needs.discover.outputs.matrix) }} steps: @@ -117,11 +118,26 @@ jobs: distribution: temurin java-version: 25-ea - - name: Create JDK 25 path + - name: Configure JDK 25 path for runner OS if: contains(matrix.plan, 'java25') shell: pwsh run: | - New-Item -ItemType Junction -Path "C:\Program Files\Java\jdk-25" -Target $env:JAVA_HOME + $planFile = "test-plans/${{ matrix.plan }}.yaml" + if ($IsWindows) { + $target = "C:\Program Files\Java\jdk-25" + New-Item -ItemType Junction -Path $target -Target $env:JAVA_HOME -Force | Out-Null + Write-Host "Created junction: $target -> $env:JAVA_HOME" + } else { + # Linux and macOS: symlink JAVA_HOME to a known location and + # rewrite the Windows-style java.jdt.ls.java.home in the plan + # so the language server resolves JDK 25 on this runner. + $target = "/opt/jdk-25" + sudo mkdir -p /opt + sudo ln -sfn $env:JAVA_HOME $target + Write-Host "Created symlink: $target -> $env:JAVA_HOME" + (Get-Content $planFile -Raw) -replace 'C:\\\\Program Files\\\\Java\\\\jdk-25', $target | Set-Content $planFile + Write-Host "Patched $planFile java.jdt.ls.java.home -> $target" + } - name: Setup Java 21 uses: actions/setup-java@v4 @@ -132,6 +148,17 @@ jobs: - name: Install autotest CLI run: npm install -g @vscjava/vscode-autotest + - name: Setup virtual display (Linux) + if: runner.os == 'Linux' + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y xvfb + Xvfb :99 -screen 0 1920x1080x24 & + echo "DISPLAY=:99" >> "$GITHUB_ENV" + # Give Xvfb a moment to start before the autotest CLI launches VS Code. + sleep 2 + - name: Download PR VSIX (vscode-java-pack from branch) if: ${{ github.event_name == 'pull_request' }} uses: actions/download-artifact@v4 @@ -217,7 +244,7 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: results-${{ matrix.plan }} + name: results-${{ matrix.plan }}-${{ matrix.os }} path: test-results/ retention-days: 30 @@ -246,10 +273,13 @@ jobs: - name: Organize results run: | mkdir -p test-results + # Each artifact is named results--; keep that suffix so + # Windows and Linux runs of the same plan don't collide. for dir in all-results/results-*/; do + artifact=$(basename "$dir") # results-- + suffix="${artifact#results-}" # - find "$dir" -name "results.json" -exec dirname {} \; | while read d; do - name=$(basename "$d") - cp -r "$d" "test-results/$name" + cp -r "$d" "test-results/$suffix" done done echo "Organized results:"