Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 20
java-version: 21
distribution: temurin

- name: Setup Node.js
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Test

on:
push:
branches: ['**']
pull_request:
workflow_call:

concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
checks:
name: Checks
runs-on: ubuntu-latest

defaults:
run:
working-directory: client

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 21

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI builds the server with JDK 21, but publish.yml builds the shipped JAR with JDK 20. server/pom.xml sets <source>20</source> / <target>20</target> but no <release>, so under JDK 21 javac compiles against the JDK 21 class library and accepts 21-only APIs such as List.getFirst(). A change like that passes here and only fails when a release tag is pushed, which is the case #125 is meant to catch.

Suggest using the same JDK in both workflows, and setting <maven.compiler.release>20</maven.compiler.release> (or <release>20</release> in the compiler plugin) so javac rejects newer APIs regardless of the JDK.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aligned both workflows on JDK 21 and replaced source/target settings with Maven release 20 in 3043e40. Maven packaging passed, and a focused compile check confirms Java 21-only List.getFirst() is rejected. Extension installation also passed.

distribution: temurin

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: client/package-lock.json

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Type-check
run: npx tsc --noEmit

- name: Build server
working-directory: server
run: |
mvn -B package
mkdir -p ../client/server
cp target/language-server-liquidjava.jar ../client/server/

- name: Package extension
run: npx vsce package --out liquid-java.vsix

- name: Check packaged runtime files
run: |
unzip -Z1 liquid-java.vsix > /tmp/liquid-java-vsix-files.txt
grep -Fx 'extension/dist/server/language-server-liquidjava.jar' /tmp/liquid-java-vsix-files.txt
grep -Fx 'extension/media/webview.js' /tmp/liquid-java-vsix-files.txt
7 changes: 1 addition & 6 deletions server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${pVersion.compiler}</version>
<configuration>
<source>20</source>
<target>20</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -102,8 +98,7 @@
<properties>
<lsp4j.version>0.24.0</lsp4j.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>20</maven.compiler.source>
<maven.compiler.target>20</maven.compiler.target>
<maven.compiler.release>20</maven.compiler.release>
<!-- versions -->
<version.memcompiler>1.3.0</version.memcompiler>
<version.spoon>10.4.2</version.spoon>
Expand Down
Loading