From dcd9e6fc818374720a630efb30b41bfb8b72a05e Mon Sep 17 00:00:00 2001 From: Alexander Shnaider Date: Thu, 23 Oct 2025 11:16:55 +0200 Subject: [PATCH 1/2] CI: update github CI to have a smoke run and save log if fails --- .github/workflows/pr-build-check.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/pr-build-check.yaml b/.github/workflows/pr-build-check.yaml index ac6ed6de..87687f60 100644 --- a/.github/workflows/pr-build-check.yaml +++ b/.github/workflows/pr-build-check.yaml @@ -29,3 +29,24 @@ jobs: - name: Maven clean install (compile only) run: mvn -B -ntp -DskipTests clean install + + - name: Smoke run demos (fail on runtime exceptions) + 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 + } + + - name: Upload run.log on failure + if: failure() + uses: actions/upload-artifact@v4 + with: + name: run-log + path: run.log \ No newline at end of file From f711e2bc59f24a26833bb80c97db0988f14f5f0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alois=20Se=C4=8Dk=C3=A1r?= Date: Thu, 23 Oct 2025 19:23:59 +0200 Subject: [PATCH 2/2] feat: prevent upload step being triggered from other failed step --- .github/workflows/pr-build-check.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-build-check.yaml b/.github/workflows/pr-build-check.yaml index 87687f60..9b60285a 100644 --- a/.github/workflows/pr-build-check.yaml +++ b/.github/workflows/pr-build-check.yaml @@ -30,7 +30,8 @@ jobs: - name: Maven clean install (compile only) run: mvn -B -ntp -DskipTests clean install - - name: Smoke run demos (fail on runtime exceptions) + - name: Test run (fail on runtime exceptions) + id: demo-run shell: bash run: | set -euo pipefail @@ -44,9 +45,9 @@ jobs: exit 1 } - - name: Upload run.log on failure - if: failure() + - name: Upload run.log on runtime failure + if: steps.demo-run.outcome == 'failure' uses: actions/upload-artifact@v4 with: name: run-log - path: run.log \ No newline at end of file + path: run.log