|
6 | 6 | pull_request: |
7 | 7 | branches: [ main ] |
8 | 8 |
|
| 9 | +# Parallelized E2E pipeline (Linux): |
| 10 | +# build-linux → packages VSIX once and uploads as artifact |
| 11 | +# discover-plans → emits a matrix of test-plan basenames |
| 12 | +# e2e-linux (matrix) → one job per plan, all running in parallel |
| 13 | +# analyze-linux → aggregates results.json from every plan |
| 14 | +# |
| 15 | +# Modelled after vscode-java-pack/.github/workflows/e2e-autotest.yml. |
| 16 | +# Splitting plans across jobs keeps each job well under the per-job |
| 17 | +# 30-minute timeout and surfaces individual plan failures independently. |
| 18 | + |
9 | 19 | jobs: |
10 | | - linuxUI: |
| 20 | + # ── Job 1: Build the VSIX once ────────────────────────── |
| 21 | + build-linux: |
| 22 | + name: Build VSIX (Linux) |
| 23 | + runs-on: ubuntu-latest |
| 24 | + timeout-minutes: 20 |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v4 |
| 27 | + |
| 28 | + - name: Set up JDK 21 |
| 29 | + uses: actions/setup-java@v4 |
| 30 | + with: |
| 31 | + java-version: '21' |
| 32 | + distribution: 'temurin' |
| 33 | + |
| 34 | + - name: Setup Node.js environment |
| 35 | + uses: actions/setup-node@v4 |
| 36 | + with: |
| 37 | + node-version: 20 |
| 38 | + |
| 39 | + - name: Install Node.js modules |
| 40 | + run: npm install |
| 41 | + |
| 42 | + - name: Install VSCE |
| 43 | + run: npm install -g @vscode/vsce |
| 44 | + |
| 45 | + - name: Build OSGi bundle |
| 46 | + run: npm run build-server |
| 47 | + |
| 48 | + - name: Build VSIX file |
| 49 | + run: vsce package -o vscode-java-dependency.vsix |
| 50 | + |
| 51 | + - name: Upload VSIX artifact |
| 52 | + uses: actions/upload-artifact@v4 |
| 53 | + with: |
| 54 | + name: vsix-linux |
| 55 | + path: vscode-java-dependency.vsix |
| 56 | + retention-days: 1 |
| 57 | + |
| 58 | + # ── Job 2: Discover test plans ────────────────────────── |
| 59 | + discover-plans: |
| 60 | + name: Discover E2E Plans |
| 61 | + runs-on: ubuntu-latest |
| 62 | + outputs: |
| 63 | + matrix: ${{ steps.scan.outputs.matrix }} |
| 64 | + steps: |
| 65 | + - uses: actions/checkout@v4 |
| 66 | + |
| 67 | + - name: Scan test plans |
| 68 | + id: scan |
| 69 | + shell: bash |
| 70 | + run: | |
| 71 | + plans=$(ls test/e2e-plans/*.yaml | xargs -n1 basename | sed 's/\.yaml$//' | jq -R . | jq -sc .) |
| 72 | + echo "matrix=$plans" >> "$GITHUB_OUTPUT" |
| 73 | + echo "Found plans: $plans" |
| 74 | +
|
| 75 | + # ── Job 3: Run each plan in parallel ──────────────────── |
| 76 | + e2e-linux: |
| 77 | + name: Linux-UI (${{ matrix.plan }}) |
| 78 | + needs: [ build-linux, discover-plans ] |
| 79 | + runs-on: ubuntu-latest |
| 80 | + timeout-minutes: 25 |
| 81 | + strategy: |
| 82 | + fail-fast: false |
| 83 | + matrix: |
| 84 | + plan: ${{ fromJson(needs.discover-plans.outputs.matrix) }} |
| 85 | + |
| 86 | + steps: |
| 87 | + - uses: actions/checkout@v4 |
| 88 | + |
| 89 | + - name: Setup Build Environment |
| 90 | + run: | |
| 91 | + sudo apt-get update |
| 92 | + sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1 |
| 93 | + # Use 1920x1080 so the Java Projects view (rendered inside the Explorer |
| 94 | + # sidebar) gets enough vertical space. With 1024x768 the sticky |
| 95 | + # pane-header overlapped tree rows and intercepted click events. |
| 96 | + sudo /usr/bin/Xvfb :99 -screen 0 1920x1080x24 > /dev/null 2>&1 & |
| 97 | + sleep 3 |
| 98 | +
|
| 99 | + - name: Set up JDK 21 |
| 100 | + uses: actions/setup-java@v4 |
| 101 | + with: |
| 102 | + java-version: '21' |
| 103 | + distribution: 'temurin' |
| 104 | + |
| 105 | + - name: Setup Node.js environment |
| 106 | + uses: actions/setup-node@v4 |
| 107 | + with: |
| 108 | + node-version: 20 |
| 109 | + |
| 110 | + - name: Setup autotest |
| 111 | + run: npm install -g @vscjava/vscode-autotest |
| 112 | + |
| 113 | + - name: Download VSIX artifact |
| 114 | + uses: actions/download-artifact@v4 |
| 115 | + with: |
| 116 | + name: vsix-linux |
| 117 | + path: . |
| 118 | + |
| 119 | + - name: E2E Test — ${{ matrix.plan }} |
| 120 | + env: |
| 121 | + AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }} |
| 122 | + AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} |
| 123 | + AZURE_OPENAI_DEPLOYMENT: ${{ secrets.AZURE_OPENAI_DEPLOYMENT }} |
| 124 | + run: | |
| 125 | + DISPLAY=:99 autotest run "test/e2e-plans/${{ matrix.plan }}.yaml" \ |
| 126 | + --vsix "$(pwd)/vscode-java-dependency.vsix" \ |
| 127 | + --output "test-results/${{ matrix.plan }}" |
| 128 | +
|
| 129 | + - name: Upload test results |
| 130 | + if: ${{ always() }} |
| 131 | + uses: actions/upload-artifact@v4 |
| 132 | + with: |
| 133 | + name: e2e-results-linux-${{ matrix.plan }} |
| 134 | + path: test-results/ |
| 135 | + retention-days: 7 |
| 136 | + |
| 137 | + # ── Job 4: Aggregate analysis ─────────────────────────── |
| 138 | + analyze-linux: |
| 139 | + name: Linux-UI Summary |
| 140 | + needs: e2e-linux |
| 141 | + if: ${{ always() }} |
| 142 | + runs-on: ubuntu-latest |
| 143 | + steps: |
| 144 | + - name: Setup Node.js environment |
| 145 | + uses: actions/setup-node@v4 |
| 146 | + with: |
| 147 | + node-version: 20 |
| 148 | + |
| 149 | + - name: Setup autotest |
| 150 | + run: npm install -g @vscjava/vscode-autotest |
| 151 | + |
| 152 | + - name: Download all plan results |
| 153 | + uses: actions/download-artifact@v4 |
| 154 | + with: |
| 155 | + pattern: e2e-results-linux-* |
| 156 | + path: all-results |
| 157 | + merge-multiple: false |
| 158 | + |
| 159 | + - name: Organize results |
| 160 | + shell: bash |
| 161 | + run: | |
| 162 | + mkdir -p test-results |
| 163 | + for dir in all-results/e2e-results-linux-*/; do |
| 164 | + find "$dir" -name "results.json" -exec dirname {} \; | while read d; do |
| 165 | + name=$(basename "$d") |
| 166 | + mkdir -p "test-results/$name" |
| 167 | + cp -r "$d"/. "test-results/$name"/ |
| 168 | + done |
| 169 | + done |
| 170 | + echo "Organized plan result directories:" |
| 171 | + ls test-results/ || true |
| 172 | +
|
| 173 | + - name: Analyze results |
| 174 | + env: |
| 175 | + AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }} |
| 176 | + AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} |
| 177 | + AZURE_OPENAI_DEPLOYMENT: ${{ secrets.AZURE_OPENAI_DEPLOYMENT }} |
| 178 | + run: autotest analyze test-results --output test-results |
| 179 | + |
| 180 | + - name: Write Job Summary |
| 181 | + if: always() |
| 182 | + shell: bash |
| 183 | + run: | |
| 184 | + if [ -f test-results/summary.md ]; then |
| 185 | + cat test-results/summary.md >> "$GITHUB_STEP_SUMMARY" |
| 186 | + fi |
| 187 | +
|
| 188 | + - name: Upload aggregate summary |
| 189 | + if: always() |
| 190 | + uses: actions/upload-artifact@v4 |
| 191 | + with: |
| 192 | + name: e2e-aggregate-summary-linux |
| 193 | + path: test-results/summary.md |
| 194 | + retention-days: 30 |
| 195 | + |
| 196 | + # ── Job 5: Branch-protection compatibility gate ───────── |
| 197 | + # Preserves the original required-status-check name `Linux-UI` |
| 198 | + # so existing branch-protection rules keep working without edits. |
| 199 | + # Fails if any upstream job did not succeed. |
| 200 | + linux-ui: |
11 | 201 | name: Linux-UI |
| 202 | + needs: [ build-linux, discover-plans, e2e-linux, analyze-linux ] |
| 203 | + if: ${{ always() }} |
12 | 204 | runs-on: ubuntu-latest |
13 | | - timeout-minutes: 30 |
14 | 205 | steps: |
15 | | - - uses: actions/checkout@v4 |
16 | | - |
17 | | - - name: Setup Build Environment |
18 | | - run: | |
19 | | - sudo apt-get update |
20 | | - sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1 |
21 | | - # Use 1920x1080 so the Java Projects view (rendered inside the Explorer |
22 | | - # sidebar) gets enough vertical space. With 1024x768 the sticky |
23 | | - # pane-header overlapped tree rows and intercepted click events. |
24 | | - sudo /usr/bin/Xvfb :99 -screen 0 1920x1080x24 > /dev/null 2>&1 & |
25 | | - sleep 3 |
26 | | -
|
27 | | - - name: Set up JDK 21 |
28 | | - uses: actions/setup-java@v4 |
29 | | - with: |
30 | | - java-version: '21' |
31 | | - distribution: 'temurin' |
32 | | - |
33 | | - - name: Setup Node.js environment |
34 | | - uses: actions/setup-node@v4 |
35 | | - with: |
36 | | - node-version: 20 |
37 | | - |
38 | | - - name: Install Node.js modules |
39 | | - run: npm install |
40 | | - |
41 | | - - name: Install VSCE |
42 | | - run: npm install -g @vscode/vsce |
43 | | - |
44 | | - - name: Build OSGi bundle |
45 | | - run: npm run build-server |
46 | | - |
47 | | - - name: Build VSIX file |
48 | | - run: vsce package -o vscode-java-dependency.vsix |
49 | | - |
50 | | - - name: Setup autotest |
51 | | - run: npm install -g @vscjava/vscode-autotest |
52 | | - |
53 | | - - name: E2E Test (autotest) |
54 | | - env: |
55 | | - AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }} |
56 | | - AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} |
57 | | - AZURE_OPENAI_DEPLOYMENT: ${{ secrets.AZURE_OPENAI_DEPLOYMENT }} |
58 | | - run: | |
59 | | - DISPLAY=:99 autotest run-all test/e2e-plans \ |
60 | | - --vsix $(pwd)/vscode-java-dependency.vsix \ |
61 | | - --output test-results |
62 | | -
|
63 | | - - name: Upload test results |
64 | | - if: ${{ always() }} |
65 | | - uses: actions/upload-artifact@v4 |
66 | | - with: |
67 | | - name: e2e-results-linux |
68 | | - path: test-results/ |
69 | | - retention-days: 7 |
70 | | - |
71 | | - - name: Write Job Summary |
72 | | - if: always() |
73 | | - run: | |
74 | | - if [ -f test-results/summary.md ]; then |
75 | | - cat test-results/summary.md >> "$GITHUB_STEP_SUMMARY" |
76 | | - fi |
| 206 | + - name: Verify required jobs |
| 207 | + shell: bash |
| 208 | + run: | |
| 209 | + echo "build-linux: ${{ needs.build-linux.result }}" |
| 210 | + echo "discover-plans: ${{ needs.discover-plans.result }}" |
| 211 | + echo "e2e-linux: ${{ needs.e2e-linux.result }}" |
| 212 | + echo "analyze-linux: ${{ needs.analyze-linux.result }}" |
| 213 | + if [ "${{ needs.build-linux.result }}" != "success" ] || \ |
| 214 | + [ "${{ needs.discover-plans.result }}" != "success" ] || \ |
| 215 | + [ "${{ needs.e2e-linux.result }}" != "success" ] || \ |
| 216 | + [ "${{ needs.analyze-linux.result }}" != "success" ]; then |
| 217 | + echo "::error::One or more required Linux-UI jobs failed" |
| 218 | + exit 1 |
| 219 | + fi |
| 220 | +
|
0 commit comments