Skip to content

Commit 94c43b3

Browse files
committed
Smoke test all binaries using matrix build
This lets us smoke test the binaries for every platform instead of just linux x86_64. The builds are run in parallel, which looks a bit messy in the output but hopefully will mean it takes around 10 minutes to get all the results. I wrote the windows part so that it can be expanded to include arm64 in the future. Signed-off-by: David Thompson <davthomp@redhat.com>
1 parent 9e06486 commit 94c43b3

File tree

5 files changed

+158
-40
lines changed

5 files changed

+158
-40
lines changed

.github/workflows/ci.yaml

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,43 +16,42 @@ jobs:
1616
- name: Run ESLint
1717
run: npm run eslint
1818

19-
build-test-native-image:
20-
runs-on: ubuntu-latest
21-
steps:
22-
- uses: actions/checkout@v4
23-
with:
24-
repository: 'eclipse/lemminx'
25-
- uses: graalvm/setup-graalvm@557ffcf459751b4d92319ee255bf3bec9b73964c #v1.2.5
26-
with:
27-
distribution: graalvm-community
28-
java-version: 17
29-
- run: ./mvnw -B package -Dnative -DskipTests -Dgraalvm.static=-H:+StaticExecutableWithDynamicLibC -Dcbi.jarsigner.skip=true
30-
- run: mv org.eclipse.lemminx/target/lemminx-* lemminx-linux
31-
- uses: actions/upload-artifact@v4
32-
with:
33-
name: lemminx-linux
34-
path: lemminx-linux
35-
if-no-files-found: error
19+
matrix-smoke-test:
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
label: [linux-x86_64, linux-aarch_64, osx-x86_64, osx-aarch_64]
24+
include:
25+
- label: linux-x86_64
26+
os: ubuntu-latest
27+
startx: xvfb-run
28+
graalOpt: -Dgraalvm.static=-H:+StaticExecutableWithDynamicLibC
29+
- label: linux-aarch_64
30+
os: ubuntu-24.04-arm
31+
startx: xvfb-run
32+
graalOpt: -Dgraalvm.static=-H:+StaticExecutableWithDynamicLibC
33+
- label: osx-x86_64
34+
os: macos-15-intel
35+
- label: osx-aarch_64
36+
os: macos-latest
37+
uses: ./.github/workflows/smoke-test.yaml
38+
with:
39+
os: ${{ matrix.os }}
40+
label: ${{ matrix.label }}
41+
graalOpt: ${{ matrix.graalOpt }}
42+
startx: ${{ matrix.startx }}
43+
secrets: inherit
3644

37-
smoke-test:
38-
runs-on: ubuntu-latest
39-
needs: build-test-native-image
40-
steps:
41-
- uses: actions/checkout@v4
42-
- uses: actions/download-artifact@v4
43-
with:
44-
name: lemminx-linux
45-
path: server
46-
- name: Make lemminx binary executable
47-
run: chmod u+x ./server/lemminx-linux
48-
- name: Make lemminx binary trusted
49-
run: sha256sum ./server/lemminx-linux > ./server/lemminx-linux.sha256
50-
- name: Install dependencies
51-
run: npm i --also=dev
52-
- name: Run smoke test suite
53-
run: xvfb-run npm test
54-
- name: Delete lemminx binary
55-
if: always()
56-
uses: geekyeggo/delete-artifact@e46cfb9575865f907c2beb2e4170b5f4c7d77c52
57-
with:
58-
name: lemminx-linux
45+
matrix-smoke-test-windows:
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
label: [win32]
50+
include:
51+
- label: win32
52+
os: windows-latest
53+
uses: ./.github/workflows/smoke-test-windows.yaml
54+
with:
55+
os: ${{ matrix.os }}
56+
label: ${{ matrix.label }}
57+
secrets: inherit
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Smoke test (Windows)
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
os:
7+
required: true
8+
type: string
9+
label:
10+
required: true
11+
type: string
12+
13+
jobs:
14+
build-test-native-image:
15+
runs-on: ${{ inputs.os }}
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
repository: 'eclipse/lemminx'
20+
- uses: graalvm/setup-graalvm@557ffcf459751b4d92319ee255bf3bec9b73964c #v1.2.5
21+
with:
22+
distribution: graalvm-community
23+
java-version: 17
24+
- run: .\mvnw.cmd -B package -Dnative -DskipTests -D "cbi.jarsigner.skip=true"
25+
- run: mv org.eclipse.lemminx\target\lemminx-* lemminx-${{ inputs.label }}.exe
26+
- uses: actions/upload-artifact@v4
27+
with:
28+
name: lemminx-${{ inputs.label }}
29+
path: lemminx-${{ inputs.label }}.exe
30+
if-no-files-found: error
31+
32+
smoke-test:
33+
runs-on: ${{ inputs.os }}
34+
needs: build-test-native-image
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: actions/download-artifact@v4
38+
with:
39+
name: lemminx-${{ inputs.label }}
40+
path: server
41+
- name: Make lemminx binary trusted
42+
run: certUtil -hashfile .\server\lemminx-${{ inputs.label }}.exe SHA256 | findstr /v "hash" > .\server\lemminx-${{ inputs.label }}.sha256
43+
- name: show hash
44+
run: type .\server\lemminx-${{ inputs.label }}.sha256
45+
- name: Install dependencies
46+
run: npm i --also=dev
47+
- name: Run smoke test suite
48+
run: npm test
49+
- name: Delete lemminx binary
50+
if: always()
51+
uses: geekyeggo/delete-artifact@e46cfb9575865f907c2beb2e4170b5f4c7d77c52
52+
with:
53+
name: lemminx-${{ inputs.label }}

.github/workflows/smoke-test.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Smoke test
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
os:
7+
required: true
8+
type: string
9+
label:
10+
required: true
11+
type: string
12+
graalOpt:
13+
required: false
14+
type: string
15+
startx:
16+
required: false
17+
type: string
18+
19+
jobs:
20+
build-test-native-image:
21+
runs-on: ${{ inputs.os }}
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
repository: 'eclipse/lemminx'
26+
- uses: graalvm/setup-graalvm@557ffcf459751b4d92319ee255bf3bec9b73964c #v1.2.5
27+
with:
28+
distribution: graalvm-community
29+
java-version: 17
30+
- run: ./mvnw -B package -Dnative -DskipTests ${{ inputs.graalOpt }} -Dcbi.jarsigner.skip=true
31+
- run: mv org.eclipse.lemminx/target/lemminx-* lemminx-${{ inputs.label }}
32+
- uses: actions/upload-artifact@v4
33+
with:
34+
name: lemminx-${{ inputs.label }}
35+
path: lemminx-${{ inputs.label }}
36+
if-no-files-found: error
37+
38+
smoke-test:
39+
runs-on: ${{ inputs.os }}
40+
needs: build-test-native-image
41+
steps:
42+
- uses: actions/checkout@v4
43+
- uses: actions/download-artifact@v4
44+
with:
45+
name: lemminx-${{ inputs.label }}
46+
path: server
47+
- name: Make lemminx binary executable
48+
run: chmod u+x ./server/lemminx-${{ inputs.label }}
49+
- name: Make lemminx binary trusted
50+
run: openssl sha256 ./server/lemminx-${{ inputs.label }} | awk '{print $2}' > ./server/lemminx-${{ inputs.label }}.sha256
51+
- name: Install dependencies
52+
run: npm i --also=dev
53+
- name: Run smoke test suite
54+
run: ${{ inputs.startx }} npm test
55+
- name: Delete lemminx binary
56+
if: always()
57+
uses: geekyeggo/delete-artifact@e46cfb9575865f907c2beb2e4170b5f4c7d77c52
58+
with:
59+
name: lemminx-${{ inputs.label }}

src/server/binary/binaryServerStarter.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,13 @@ function getServerBinaryNameWithoutExtension(): string {
220220
default:
221221
return 'lemminx-osx-x86_64';
222222
}
223+
case 'linux':
224+
switch (os.arch()) {
225+
case 'arm64':
226+
return 'lemminx-linux-aarch_64';
227+
default:
228+
return 'lemminx-linux-x86_64';
229+
}
223230
default:
224231
return `lemminx-${os.platform()}`;
225232
}

src/test/smoke.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ suite('Smoke tests', function () {
1919
this.timeout(10_000);
2020

2121
// diagnostics take some time to appear; the language server must be started and respond to file open event
22-
const DIAGNOSTICS_DELAY = 4_000;
22+
const DIAGNOSTICS_DELAY = 6_000;
2323

2424
const SCHEMA = `<?xml version="1.0" encoding="UTF-8"?>
2525
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

0 commit comments

Comments
 (0)