Skip to content

Commit 87cc953

Browse files
committed
Fix workflows
1 parent d8d4d1e commit 87cc953

4 files changed

Lines changed: 40 additions & 19 deletions

File tree

.github/workflows/ci.yml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
path: ./bundles/com.salesforce.bazel.sdk/aspects/aspects*.zip
6666
key: ${{ runner.os }}-aspects-${{ hashFiles('**/aspects/import/import-and-build.sh', '**/aspects/import/MODULE.bazel*') }}
6767

68-
- name: Cache Bazel repository cache
68+
- name: Cache Bazel repository cache
6969
uses: actions/cache@v4
7070
with:
7171
path: |
@@ -80,8 +80,9 @@ jobs:
8080
- name: Setup Node version
8181
uses: actions/setup-node@v6
8282
with:
83-
node-version: 22
8483
cache: 'npm'
84+
cache-dependency-path: 'vscode/package-lock.json'
85+
node-version-file: 'vscode/package.json'
8586

8687
- name: Print Maven toolchains.xml
8788
shell: bash
@@ -92,7 +93,7 @@ jobs:
9293
shell: bash
9394
run: ./import-and-build.sh
9495

95-
- name: Build and Test Eclipse & JDTLS PLug-in
96+
- name: Build and Test Eclipse & JDTLS Plug-ins
9697
uses: coactions/setup-xvfb@v1
9798
env:
9899
BUILD_ID: "${{ steps.time.outputs.time }}"
@@ -101,6 +102,13 @@ jobs:
101102
with:
102103
run: ./mvnw --batch-mode --no-transfer-progress --strict-checksums --fail-at-end -update-snapshots --show-version --errors clean verify
103104

105+
- name: Upload Maven Test Results
106+
uses: actions/upload-artifact@v5
107+
if: always()
108+
with:
109+
name: test-results-maven-${{ matrix.os }}
110+
path: tests/**/target/surefire-reports/*.xml
111+
104112
- name: Install Node dependencies
105113
working-directory: ./vscode
106114
run: npm ci
@@ -113,23 +121,21 @@ jobs:
113121
BUILD_LABEL: "CI ${{ steps.time.outputs.time }} (${{ steps.branch_name.outputs.branch }})"
114122
run: npm run build
115123

116-
- name: Run VS Code Extenion Tests
124+
- name: Run VS Code Extension Tests
117125
uses: GabrielBB/xvfb-action@v1.7
118-
working-directory: ./vscode
119126
env:
120127
PRINT_JDTLS_LOGS: true
121128
with:
122129
run: npm run test
130+
working-directory: ./vscode
123131
options: "-screen 0 1600x1200x24"
124132

125-
- name: Upload Test Results
126-
uses: actions/upload-artifact@v4
133+
- name: Upload VS Code Test Results
134+
uses: actions/upload-artifact@v5
127135
if: always()
128136
with:
129-
name: test-results-${{ matrix.os }}
130-
path:
137+
name: test-results-vscode-${{ matrix.os }}
131138
path: |
132-
tests/**/target/surefire-reports/*.xml
133139
vscode/test/**/*.xml
134140
vscode/test/**/*.json
135141
!vscode/test/**/tsconfig.json
@@ -146,15 +152,15 @@ jobs:
146152
vscode/test/logs
147153
148154
- name: Upload p2 Repository
149-
uses: actions/upload-artifact@v4
155+
uses: actions/upload-artifact@v5
150156
if: success() && matrix.os == 'ubuntu-latest'
151157
with:
152158
name: p2-repository
153159
path: releng/p2repository/target/repository/
154160
if-no-files-found: error
155161

156162
- name: Upload JDTLS Products
157-
uses: actions/upload-artifact@v4
163+
uses: actions/upload-artifact@v5
158164
if: success() && matrix.os == 'ubuntu-latest'
159165
with:
160166
name: jdt-bazel-ls
@@ -164,7 +170,7 @@ jobs:
164170
if-no-files-found: error
165171

166172
- name: Upload SCIPLS Products
167-
uses: actions/upload-artifact@v4
173+
uses: actions/upload-artifact@v5
168174
if: success() && matrix.os == 'ubuntu-latest'
169175
with:
170176
name: scip-bazel-ls
@@ -188,7 +194,7 @@ jobs:
188194
# needed for publishing test results from forks
189195
steps:
190196
- name: Upload
191-
uses: actions/upload-artifact@v4
197+
uses: actions/upload-artifact@v5
192198
with:
193199
name: ci-event-file
194200
path: ${{ github.event_path }}

.github/workflows/publish-vscode-extension.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ jobs:
3030
name: Publish Latest VS Code Extension
3131
runs-on: ubuntu-latest
3232

33+
# we are very restrictive when this runs, i.e. only on main, only on success and only with the bazel-eclipse repository (not on forks)
34+
if: >
35+
( !github.event.workflow_run ||
36+
( github.event.workflow_run.conclusion == 'success' &&
37+
github.event.workflow_run.event != 'pull_request' )
38+
) &&
39+
github.repository == 'eclipseguru/bazel-eclipse' &&
40+
github.ref == 'refs/heads/main'
41+
3342
steps:
3443
- name: Checkout
3544
uses: actions/checkout@v5
@@ -47,8 +56,9 @@ jobs:
4756
- name: Setup Node version
4857
uses: actions/setup-node@v6
4958
with:
50-
node-version: 22
5159
cache: 'npm'
60+
cache-dependency-path: 'vscode/package-lock.json'
61+
node-version-file: 'vscode/package.json'
5262

5363
- name: 📦 Install dependencies
5464
run: |

vscode/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"bugs": "https://github.com/eclipseguru/bazel-eclipse/issues",
1010
"preview": true,
1111
"engines": {
12-
"vscode": "^1.80.0"
12+
"node": "^22.20.0",
13+
"vscode": "^1.106.0"
1314
},
1415
"repository": {
1516
"type": "git",

vscode/scripts/server.mjs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,13 @@ async function buildServer() {
8686
fs.ensureDirSync('./server');
8787

8888
try {
89-
const command = `${mvnw()} clean package -DskipTests=true`;
90-
console.log(`Executing: ${command}`);
91-
execSync(command, { cwd: serverDir, stdio: [0, 1, 2] });
89+
const jdtlsJars = await glob(`${serverDir}/releng/p2repository/target/repository/plugins/com.salesforce.bazel.eclipse.jdtls_*.jar`);
90+
if(jdtlsJars.length != 1) {
91+
console.log('Building Bazel JDT Language Server extension from source...');
92+
const command = `${mvnw()} clean package -DskipTests=true`;
93+
console.log(`Executing: ${command}`);
94+
execSync(command, { cwd: serverDir, stdio: [0, 1, 2] });
95+
}
9296

9397
const sources = await glob(`${serverDir}/releng/p2repository/target/repository/plugins/*.jar`);
9498

0 commit comments

Comments
 (0)