Skip to content
Closed
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
30 changes: 30 additions & 0 deletions .github/workflows/pr-build-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: PR build check (Compile against Java 25 using Maven)
on:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:

permissions:
contents: read
Expand All @@ -29,3 +30,32 @@ jobs:

- name: Maven clean install (compile only)
run: mvn -B -ntp -DskipTests clean install

- name: Smoke run demos (fail on runtime exceptions)
if: always()
shell: bash
run: |
set -euo pipefail
mkdir -p tmp
export JAVA_TOOL_OPTIONS="-Djava.io.tmpdir=$(pwd)/tmp"

java --enable-preview --add-modules=jdk.incubator.vector \
-jar target/JavaDemos-25.0.jar > run.log 2>&1 || {
echo "Non-zero exit code:"
cat run.log
exit 1
}

# Fail if stack trace frames OR 'Exception in thread "main"' appear
if grep -F -q 'Exception in thread "main"'; then
echo "Detected stack trace or 'Exception in thread \"main\"':"
cat run.log
exit 1
fi

- name: Upload run.log on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: run-log
path: run.log
3 changes: 2 additions & 1 deletion src/main/java/org/javademos/init/Java17.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public static ArrayList<IDemo> getDemos() {
// JEP 414
java17DemoPool.add(new VectorAPIDemo());
// JEP 415
java17DemoPool.add(new ContextSpecificDeserializationFiltersDemo());
//now should fail
java17DemoPool.add(new ContextSpecificDeserializationFiltersDemo())

// older demos created with "non-JEP" style
java17DemoPool.add(new String12Demo());
Expand Down
Loading