From fab017fddcce6c944d1c62357f01d79eb9dc68f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pereda?= Date: Fri, 6 Dec 2024 09:23:43 +0100 Subject: [PATCH] Run headless tests (#383) --- .github/workflows/build.yml | 17 +++-------- .github/workflows/release.yml | 7 ++--- rta/pom.xml | 57 +++++++++++++++++++++++++++++------ 3 files changed, 56 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 99a8138..2e0e113 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,29 +18,22 @@ jobs: - name: Setup Java uses: actions/setup-java@v4 with: - java-version: 21 + java-version: 22 distribution: 'oracle' cache: 'maven' server-id: ossrh server-username: MAVEN_USERNAME server-password: MAVEN_CENTRAL_TOKEN - - name: Build project (macOS) - if: runner.os == 'macOS' + - name: Build project (Linux/macOS) + if: runner.os != 'Windows' run: | - ./mvnw -B -ntp verify -f rta + ./mvnw -B -ntp -Ptest verify -f rta - name: Build project (Windows) if: runner.os == 'Windows' run: | - .\mvnw -B -ntp verify -f rta - - - name: Build project (Linux) - if: runner.os == 'Linux' - run: | - export DISPLAY=:90 - Xvfb -ac :90 -screen 0 1280x1024x24 > /dev/null 2>&1 & - ./mvnw -B -ntp verify -f rta + .\mvnw -B -ntp -Ptest verify -f rta - name: Publish Snapshots if: github.ref == 'refs/heads/main' && runner.os == 'Linux' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 71788a1..f3c1831 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: - name: Setup Java and Apache Maven uses: actions/setup-java@v4 with: - java-version: 21 + java-version: 22 distribution: 'oracle' cache: 'maven' server-id: ossrh @@ -39,9 +39,8 @@ jobs: - name: Publish to Maven Central id: deploy run: | - export DISPLAY=:90 - Xvfb -ac :90 -screen 0 1280x1024x24 > /dev/null 2>&1 & - ./mvnw -B -ntp -Prelease deploy -f rta + ./mvnw -B -ntp -Ptest verify -f rta + ./mvnw -B -Dmaven.test.skip=true -Prelease deploy -f rta echo ::set-output name=exit_code::$? env: MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }} diff --git a/rta/pom.xml b/rta/pom.xml index 7d15c26..90c2d37 100644 --- a/rta/pom.xml +++ b/rta/pom.xml @@ -18,6 +18,8 @@ 23.0.1 3.2.7 1.1.0 + + 24-headless+0-2024-12-02-101029 @@ -37,16 +39,36 @@ offline ${emoji.version} + + org.junit.jupiter junit-jupiter-engine 5.11.3 test + + org.testfx + testfx-core + 4.0.19-gluon-SNAPSHOT + test + org.testfx testfx-junit5 - 4.0.18 + 4.0.19-gluon-SNAPSHOT + test + + + org.hamcrest + hamcrest + 3.0 + test + + + org.assertj + assertj-core + 3.26.3 test @@ -107,6 +129,17 @@ + + + Gluon Releases + https://nexus.gluonhq.com/nexus/content/repositories/releases/ + + + Gluon Snapshots + https://nexus.gluonhq.com/nexus/content/repositories/public-snapshots/ + + + @@ -150,7 +183,7 @@ 3.5.2 false - --add-opens javafx.graphics/com.sun.javafx.application=ALL-UNNAMED + ${test.headless} --add-opens javafx.graphics/com.sun.javafx.application=ALL-UNNAMED java.util.logging.config.file @@ -158,13 +191,6 @@ - - - org.junit.jupiter - junit-jupiter-engine - 5.11.3 - - @@ -210,5 +236,18 @@ + + test + + -Dtestfx.headless=true + + + + org.openjfx + javafx-controls + ${test.javafx.version} + + +