Skip to content

Commit 15b9b0f

Browse files
authored
Merge pull request #644 from gigara/ls-daily-build-fixes
Fix daily build LS job failures and add label-gated LS tests to PR checks
2 parents 3b084ef + 6282661 commit 15b9b0f

33 files changed

Lines changed: 2274 additions & 2249 deletions

File tree

.github/actions/ls-test/action.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Run Ballerina LS tests
2+
description: Sets up JDK, Gradle, and Ballerina, restores the dependency cache, and runs the language server gradle test suite. The repository must already be checked out.
3+
4+
inputs:
5+
cache-branch:
6+
description: Branch name used in the Ballerina dependency cache key
7+
required: true
8+
gradle-version:
9+
description: Version passed to gradle as -Pversion (omitted when empty)
10+
required: false
11+
default: ''
12+
package-user:
13+
description: User for maven.pkg.github.com authentication
14+
required: true
15+
package-pat:
16+
description: Token for maven.pkg.github.com authentication
17+
required: true
18+
19+
runs:
20+
using: composite
21+
steps:
22+
- name: Set up JDK 21
23+
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
24+
with:
25+
distribution: 'temurin'
26+
java-version: 21.0.3
27+
28+
- name: Setup Gradle
29+
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4
30+
31+
- name: Set Up Ballerina
32+
uses: ballerina-platform/setup-ballerina@97fd67111e3c3ecdfafff96fc24d95ad909ab299 # v1.1.4
33+
with:
34+
version: 2201.13.3
35+
36+
- name: Cache Ballerina dependencies
37+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
38+
with:
39+
path: ${{ runner.os == 'Windows' && 'C:\Users\runneradmin\.ballerina\repositories\' || '/home/runner/.ballerina/repositories/' }}
40+
key: ${{ runner.os }}-ballerina-${{ inputs.cache-branch }}-${{ hashFiles('**/gradle.properties') }}
41+
restore-keys: |
42+
${{ runner.os }}-ballerina-${{ inputs.cache-branch }}-
43+
${{ runner.os }}-ballerina-
44+
45+
- name: Test with Gradle
46+
shell: bash
47+
working-directory: packages/ballerina-language-server
48+
env:
49+
packageUser: ${{ inputs.package-user }}
50+
packagePAT: ${{ inputs.package-pat }}
51+
GRADLE_PROJECT_VERSION: ${{ inputs.gradle-version }}
52+
run: |
53+
if [ "$RUNNER_OS" = "Windows" ]; then
54+
GRADLE=./gradlew.bat
55+
else
56+
GRADLE=./gradlew
57+
fi
58+
if [ -n "$GRADLE_PROJECT_VERSION" ]; then
59+
"$GRADLE" -Pversion="$GRADLE_PROJECT_VERSION" test
60+
else
61+
"$GRADLE" test
62+
fi

.github/workflows/build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ on:
3535
type: boolean
3636
required: false
3737
default: false
38+
runLSTests:
39+
type: boolean
40+
required: false
41+
default: false
3842
lsSource:
3943
description: LS source — local (build from source) or download (fetch from release tag)
4044
type: string
@@ -326,3 +330,30 @@ jobs:
326330
path: |
327331
packages/ballerina-extension/e2e-test/data/new-project/**
328332
retention-days: 5
333+
334+
LSTest_Ballerina:
335+
name: Run Ballerina LS tests (${{ matrix.os }})
336+
timeout-minutes: 60
337+
if: ${{ inputs.runLSTests }}
338+
strategy:
339+
fail-fast: false
340+
matrix:
341+
os: [ubuntu-latest, windows-latest]
342+
runs-on: ${{ matrix.os }}
343+
steps:
344+
- name: Enable long paths for Git
345+
if: runner.os == 'Windows'
346+
shell: bash
347+
run: git config --system core.longpaths true
348+
349+
- name: Checkout repository
350+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
351+
with:
352+
persist-credentials: false
353+
354+
- name: Run LS tests
355+
uses: ./.github/actions/ls-test
356+
with:
357+
cache-branch: ${{ github.ref_name }}
358+
package-user: ${{ github.actor }}
359+
package-pat: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/daily-build.yml

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ jobs:
131131
concurrency:
132132
group: ls-ubuntu-test-${{ matrix.branch }}-${{ github.ref_name }}
133133
cancel-in-progress: true
134-
defaults:
135-
run:
136-
working-directory: packages/ballerina-language-server
137134
strategy:
138135
fail-fast: false
139136
matrix:
@@ -145,33 +142,15 @@ jobs:
145142
ref: ${{ matrix.branch }}
146143
persist-credentials: false
147144

148-
- name: Set up JDK 21
149-
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
150-
with:
151-
distribution: 'temurin'
152-
java-version: 21.0.3
153-
154-
- name: Setup Gradle
155-
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4
156-
157-
- name: Set Up Ballerina
158-
uses: ballerina-platform/setup-ballerina@97fd67111e3c3ecdfafff96fc24d95ad909ab299 # v1.1.4
145+
# Resolved from the matrix.branch checkout — the action file must
146+
# also exist on release branches in the matrix.
147+
- name: Run LS tests
148+
uses: ./.github/actions/ls-test
159149
with:
160-
version: 2201.13.3
161-
162-
- name: Cache Ballerina dependencies
163-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
164-
with:
165-
path: /home/runner/.ballerina/repositories/
166-
key: ${{ runner.os }}-ballerina-${{ matrix.branch }}-${{ hashFiles('**/gradle.properties') }}
167-
restore-keys: |
168-
${{ runner.os }}-ballerina-${{ matrix.branch }}-
169-
170-
- name: Test with Gradle
171-
env:
172-
packageUser: ${{ github.actor }}
173-
packagePAT: ${{ secrets.GITHUB_TOKEN }}
174-
run: ./gradlew -Pversion=${{ matrix.version }} test
150+
cache-branch: ${{ matrix.branch }}
151+
gradle-version: ${{ matrix.version }}
152+
package-user: ${{ github.actor }}
153+
package-pat: ${{ secrets.GITHUB_TOKEN }}
175154

176155
ls-windows-build:
177156
name: LS Windows build (${{ matrix.branch }})
@@ -191,6 +170,8 @@ jobs:
191170
steps:
192171
- name: Enable long paths for Git
193172
shell: bash
173+
# Override the job default working-directory — it does not exist before checkout.
174+
working-directory: ${{ github.workspace }}
194175
run: git config --system core.longpaths true
195176

196177
- name: Checkout repository

.github/workflows/pull-request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ jobs:
5050
with:
5151
runOnAWS: ${{ contains(github.event.pull_request.labels.*.name, 'Runner/AWS') }}
5252
runBalE2ETests: ${{ contains(github.event.pull_request.labels.*.name, 'Checks/Run Ballerina UI Tests') || github.base_ref == 'stable/ballerina' }}
53+
runLSTests: ${{ contains(github.event.pull_request.labels.*.name, 'Checks/Run LS Tests') }}

common/config/rush/pnpm-config.json

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,27 @@
9494
// Security overrides — keep in sync with trivy findings. Bump to the
9595
// first fix version listed for each CVE. If a bump breaks workspace
9696
// consumers, narrow the selector (e.g. "pkg@<x.y.z": "x.y.z").
97+
"@babel/core@>=7 <8": "7.29.6",
9798
"@tootallnate/once": "3.0.1",
9899
"braces": "3.0.3",
99-
"dompurify": "3.4.0",
100+
"dompurify": "3.4.9",
101+
"form-data@>=2 <3": "2.5.6",
102+
"form-data@>=4 <5": "4.0.6",
100103
"handlebars": "4.7.9",
101104
"http-proxy": "1.18.1",
102-
"js-yaml@4": "4.1.1",
105+
"joi@>=17 <18": "17.13.4",
106+
// js-yaml v3 has no in-line fix for CVE-2026-53550; the GHSA only fixes
107+
// in v4.2.0. Force all consumers to v4 — revert with narrower selector
108+
// if a workspace package needs the v3 sync API.
109+
"js-yaml": "4.2.0",
110+
"launch-editor": "2.14.1",
111+
"markdown-it@>=14 <15": "14.2.0",
103112
"micromatch": "4.0.8",
104113
"prismjs": "1.30.0",
105-
"protobufjs": "7.5.8",
114+
"protobufjs@>=7 <8": "7.6.3",
106115
"qs@6": "6.15.2",
107116
"serialize-javascript": "7.0.5",
108-
"tmp": "0.2.6",
117+
"tmp": "0.2.7",
109118
// uuid 8.x has no in-line fix; bump to 11.1.1 (fix line for v11). Revert
110119
// if this breaks consumers that strictly need uuid v8 API.
111120
"uuid@8": "11.1.1",

0 commit comments

Comments
 (0)