Skip to content

Commit 6c1d2dd

Browse files
wenytang-msCopilot
andcommitted
ci(e2e): consolidate Linux + Windows UI workflows into one e2eUI.yml
Merges the per-OS workflows (linuxUI.yml, windowsUI.yml) into a single e2eUI.yml with a unified entry point and a single shared summary. Structure: - discover-plans (matrix output) - build-linux / build-windows (VSIX artifacts) - e2e-linux / e2e-windows (matrix) (one job per (OS, plan)) - analyze (one combined summary across both OSes, plan dirs prefixed by OS for clarity) - Linux-UI / Windows-UI (gate jobs) (preserve required status-check names) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 214a567 commit 6c1d2dd

3 files changed

Lines changed: 343 additions & 435 deletions

File tree

.github/workflows/e2eUI.yml

Lines changed: 343 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,343 @@
1+
name: E2E UI Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
# Unified parallel E2E UI pipeline for Linux + Windows.
10+
#
11+
# discover-plans → emits a matrix of test-plan basenames
12+
# build-linux / build-windows → produce VSIX once per OS, upload artifact
13+
# e2e-linux / e2e-windows (matrix)→ one job per (OS, plan), running in parallel
14+
# analyze → aggregates results from BOTH OSes into a
15+
# single unified summary in $GITHUB_STEP_SUMMARY
16+
# Linux-UI / Windows-UI (gate) → preserves the original required-status-check
17+
# names so existing branch-protection keeps working
18+
#
19+
# Modelled after vscode-java-pack/.github/workflows/e2e-autotest.yml,
20+
# but consolidates the two former workflows (linuxUI.yml, windowsUI.yml)
21+
# into one file with one shared summary.
22+
23+
jobs:
24+
# ── Discover test plans ─────────────────────────────────
25+
discover-plans:
26+
name: Discover E2E Plans
27+
runs-on: ubuntu-latest
28+
outputs:
29+
matrix: ${{ steps.scan.outputs.matrix }}
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- name: Scan test plans
34+
id: scan
35+
shell: bash
36+
run: |
37+
plans=$(ls test/e2e-plans/*.yaml | xargs -n1 basename | sed 's/\.yaml$//' | jq -R . | jq -sc .)
38+
echo "matrix=$plans" >> "$GITHUB_OUTPUT"
39+
echo "Found plans: $plans"
40+
41+
# ── Build VSIX (Linux) ──────────────────────────────────
42+
build-linux:
43+
name: Build VSIX (Linux)
44+
runs-on: ubuntu-latest
45+
timeout-minutes: 20
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Set up JDK 21
50+
uses: actions/setup-java@v4
51+
with:
52+
java-version: '21'
53+
distribution: 'temurin'
54+
55+
- name: Setup Node.js environment
56+
uses: actions/setup-node@v4
57+
with:
58+
node-version: 20
59+
60+
- name: Install Node.js modules
61+
run: npm install
62+
63+
- name: Install VSCE
64+
run: npm install -g @vscode/vsce
65+
66+
- name: Build OSGi bundle
67+
run: npm run build-server
68+
69+
- name: Build VSIX file
70+
run: vsce package -o vscode-java-dependency.vsix
71+
72+
- name: Upload VSIX artifact
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: vsix-linux
76+
path: vscode-java-dependency.vsix
77+
retention-days: 1
78+
79+
# ── Build VSIX (Windows) — also runs lint + checkstyle ──
80+
build-windows:
81+
name: Build VSIX (Windows)
82+
runs-on: windows-latest
83+
timeout-minutes: 20
84+
steps:
85+
- uses: actions/checkout@v4
86+
87+
- name: Set up JDK 21
88+
uses: actions/setup-java@v4
89+
with:
90+
java-version: '21'
91+
distribution: 'temurin'
92+
93+
- name: Setup Node.js environment
94+
uses: actions/setup-node@v4
95+
with:
96+
node-version: 20
97+
98+
- name: Install Node.js modules
99+
run: npm install
100+
101+
- name: Install VSCE
102+
run: npm install -g @vscode/vsce
103+
104+
- name: Lint
105+
run: npm run tslint
106+
107+
- name: Checkstyle
108+
working-directory: .\jdtls.ext
109+
run: .\mvnw.cmd checkstyle:check
110+
111+
- name: Build OSGi bundle
112+
run: npm run build-server
113+
114+
- name: Build VSIX file
115+
run: vsce package -o vscode-java-dependency.vsix
116+
117+
- name: Upload VSIX artifact
118+
uses: actions/upload-artifact@v4
119+
with:
120+
name: vsix-windows
121+
path: vscode-java-dependency.vsix
122+
retention-days: 1
123+
124+
# ── Run each plan in parallel (Linux) ───────────────────
125+
e2e-linux:
126+
name: Linux (${{ matrix.plan }})
127+
needs: [ build-linux, discover-plans ]
128+
runs-on: ubuntu-latest
129+
timeout-minutes: 25
130+
strategy:
131+
fail-fast: false
132+
matrix:
133+
plan: ${{ fromJson(needs.discover-plans.outputs.matrix) }}
134+
135+
steps:
136+
- uses: actions/checkout@v4
137+
138+
- name: Setup Build Environment
139+
run: |
140+
sudo apt-get update
141+
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1
142+
# Use 1920x1080 so the Java Projects view (rendered inside the Explorer
143+
# sidebar) gets enough vertical space. With 1024x768 the sticky
144+
# pane-header overlapped tree rows and intercepted click events.
145+
sudo /usr/bin/Xvfb :99 -screen 0 1920x1080x24 > /dev/null 2>&1 &
146+
sleep 3
147+
148+
- name: Set up JDK 21
149+
uses: actions/setup-java@v4
150+
with:
151+
java-version: '21'
152+
distribution: 'temurin'
153+
154+
- name: Setup Node.js environment
155+
uses: actions/setup-node@v4
156+
with:
157+
node-version: 20
158+
159+
- name: Setup autotest
160+
run: npm install -g @vscjava/vscode-autotest
161+
162+
- name: Download VSIX artifact
163+
uses: actions/download-artifact@v4
164+
with:
165+
name: vsix-linux
166+
path: .
167+
168+
- name: E2E Test — ${{ matrix.plan }}
169+
env:
170+
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
171+
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
172+
AZURE_OPENAI_DEPLOYMENT: ${{ secrets.AZURE_OPENAI_DEPLOYMENT }}
173+
run: |
174+
DISPLAY=:99 autotest run "test/e2e-plans/${{ matrix.plan }}.yaml" \
175+
--vsix "$(pwd)/vscode-java-dependency.vsix" \
176+
--output "test-results/${{ matrix.plan }}"
177+
178+
- name: Upload test results
179+
if: ${{ always() }}
180+
uses: actions/upload-artifact@v4
181+
with:
182+
name: e2e-results-linux-${{ matrix.plan }}
183+
path: test-results/
184+
retention-days: 7
185+
186+
# ── Run each plan in parallel (Windows) ─────────────────
187+
e2e-windows:
188+
name: Windows (${{ matrix.plan }})
189+
needs: [ build-windows, discover-plans ]
190+
runs-on: windows-latest
191+
timeout-minutes: 25
192+
strategy:
193+
fail-fast: false
194+
matrix:
195+
plan: ${{ fromJson(needs.discover-plans.outputs.matrix) }}
196+
197+
steps:
198+
- uses: actions/checkout@v4
199+
200+
- name: Set up JDK 21
201+
uses: actions/setup-java@v4
202+
with:
203+
java-version: '21'
204+
distribution: 'temurin'
205+
206+
- name: Setup Node.js environment
207+
uses: actions/setup-node@v4
208+
with:
209+
node-version: 20
210+
211+
- name: Setup autotest
212+
run: npm install -g @vscjava/vscode-autotest
213+
214+
- name: Download VSIX artifact
215+
uses: actions/download-artifact@v4
216+
with:
217+
name: vsix-windows
218+
path: .
219+
220+
- name: E2E Test — ${{ matrix.plan }}
221+
env:
222+
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
223+
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
224+
AZURE_OPENAI_DEPLOYMENT: ${{ secrets.AZURE_OPENAI_DEPLOYMENT }}
225+
run: |
226+
autotest run "test/e2e-plans/${{ matrix.plan }}.yaml" --vsix "$((Get-Location).Path)\vscode-java-dependency.vsix" --output "test-results\${{ matrix.plan }}"
227+
228+
- name: Upload test results
229+
if: ${{ always() }}
230+
uses: actions/upload-artifact@v4
231+
with:
232+
name: e2e-results-windows-${{ matrix.plan }}
233+
path: test-results/
234+
retention-days: 7
235+
236+
# ── Unified analysis across both OSes ───────────────────
237+
analyze:
238+
name: E2E Summary
239+
needs: [ e2e-linux, e2e-windows ]
240+
if: ${{ always() }}
241+
runs-on: ubuntu-latest
242+
steps:
243+
- name: Setup Node.js environment
244+
uses: actions/setup-node@v4
245+
with:
246+
node-version: 20
247+
248+
- name: Setup autotest
249+
run: npm install -g @vscjava/vscode-autotest
250+
251+
- name: Download all plan results
252+
uses: actions/download-artifact@v4
253+
with:
254+
pattern: e2e-results-*
255+
path: all-results
256+
merge-multiple: false
257+
258+
- name: Organize results (prefix each plan by OS)
259+
shell: bash
260+
run: |
261+
mkdir -p test-results
262+
for dir in all-results/e2e-results-linux-*/; do
263+
find "$dir" -name "results.json" -exec dirname {} \; | while read d; do
264+
name=$(basename "$d")
265+
mkdir -p "test-results/linux-$name"
266+
cp -r "$d"/. "test-results/linux-$name"/
267+
done
268+
done
269+
for dir in all-results/e2e-results-windows-*/; do
270+
find "$dir" -name "results.json" -exec dirname {} \; | while read d; do
271+
name=$(basename "$d")
272+
mkdir -p "test-results/windows-$name"
273+
cp -r "$d"/. "test-results/windows-$name"/
274+
done
275+
done
276+
echo "Organized plan result directories:"
277+
ls test-results/ || true
278+
279+
- name: Analyze results
280+
env:
281+
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
282+
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
283+
AZURE_OPENAI_DEPLOYMENT: ${{ secrets.AZURE_OPENAI_DEPLOYMENT }}
284+
run: autotest analyze test-results --output test-results
285+
286+
- name: Write Job Summary
287+
if: always()
288+
shell: bash
289+
run: |
290+
if [ -f test-results/summary.md ]; then
291+
cat test-results/summary.md >> "$GITHUB_STEP_SUMMARY"
292+
fi
293+
294+
- name: Upload aggregate summary
295+
if: always()
296+
uses: actions/upload-artifact@v4
297+
with:
298+
name: e2e-aggregate-summary
299+
path: test-results/summary.md
300+
retention-days: 30
301+
302+
# ── Branch-protection compatibility gates ───────────────
303+
# Preserve the original required-status-check names so existing
304+
# branch-protection rules keep working without edits. Each gate
305+
# checks only its own OS's pipeline (analyze is shared and excluded
306+
# so a per-OS gate can pass/fail independently).
307+
Linux-UI:
308+
name: Linux-UI
309+
needs: [ build-linux, discover-plans, e2e-linux ]
310+
if: ${{ always() }}
311+
runs-on: ubuntu-latest
312+
steps:
313+
- name: Verify Linux jobs
314+
shell: bash
315+
run: |
316+
echo "build-linux: ${{ needs.build-linux.result }}"
317+
echo "discover-plans: ${{ needs.discover-plans.result }}"
318+
echo "e2e-linux: ${{ needs.e2e-linux.result }}"
319+
if [ "${{ needs.build-linux.result }}" != "success" ] || \
320+
[ "${{ needs.discover-plans.result }}" != "success" ] || \
321+
[ "${{ needs.e2e-linux.result }}" != "success" ]; then
322+
echo "::error::One or more Linux-UI jobs failed"
323+
exit 1
324+
fi
325+
326+
Windows-UI:
327+
name: Windows-UI
328+
needs: [ build-windows, discover-plans, e2e-windows ]
329+
if: ${{ always() }}
330+
runs-on: ubuntu-latest
331+
steps:
332+
- name: Verify Windows jobs
333+
shell: bash
334+
run: |
335+
echo "build-windows: ${{ needs.build-windows.result }}"
336+
echo "discover-plans: ${{ needs.discover-plans.result }}"
337+
echo "e2e-windows: ${{ needs.e2e-windows.result }}"
338+
if [ "${{ needs.build-windows.result }}" != "success" ] || \
339+
[ "${{ needs.discover-plans.result }}" != "success" ] || \
340+
[ "${{ needs.e2e-windows.result }}" != "success" ]; then
341+
echo "::error::One or more Windows-UI jobs failed"
342+
exit 1
343+
fi

0 commit comments

Comments
 (0)