From 73da8fd7ee6250943570f392276de17748965f14 Mon Sep 17 00:00:00 2001 From: Bane Stojkovic Date: Thu, 20 Mar 2025 21:24:31 +0100 Subject: [PATCH 1/8] fix tests --- diylc/.github/workflows/test.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/diylc/.github/workflows/test.yml b/diylc/.github/workflows/test.yml index 0b7d7c72..a674abc2 100644 --- a/diylc/.github/workflows/test.yml +++ b/diylc/.github/workflows/test.yml @@ -12,8 +12,6 @@ jobs: steps: - uses: actions/checkout@v3 - with: - path: diy-layout-creator - name: Set up JDK 17 uses: actions/setup-java@v3 @@ -23,6 +21,4 @@ jobs: cache: maven - name: Build with Maven - run: | - cd diy-layout-creator/diylc - mvn -B test --file pom.xml \ No newline at end of file + run: mvn -B test --file diylc/pom.xml \ No newline at end of file From e96c60906411d1ae70487e5bf16caeb06fd5467c Mon Sep 17 00:00:00 2001 From: Bane Stojkovic Date: Thu, 20 Mar 2025 21:27:19 +0100 Subject: [PATCH 2/8] Update test.yml --- diylc/.github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/diylc/.github/workflows/test.yml b/diylc/.github/workflows/test.yml index a674abc2..bf8eee0d 100644 --- a/diylc/.github/workflows/test.yml +++ b/diylc/.github/workflows/test.yml @@ -21,4 +21,5 @@ jobs: cache: maven - name: Build with Maven - run: mvn -B test --file diylc/pom.xml \ No newline at end of file + working-directory: ./diylc + run: mvn -B test \ No newline at end of file From 8c03df4c50128a5430f229ee3a5febdbc72431d5 Mon Sep 17 00:00:00 2001 From: Bane Stojkovic Date: Thu, 20 Mar 2025 21:28:46 +0100 Subject: [PATCH 3/8] Update test.yml --- diylc/.github/workflows/test.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/diylc/.github/workflows/test.yml b/diylc/.github/workflows/test.yml index bf8eee0d..1282509d 100644 --- a/diylc/.github/workflows/test.yml +++ b/diylc/.github/workflows/test.yml @@ -11,7 +11,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v3 + with: + path: diy-layout-creator - name: Set up JDK 17 uses: actions/setup-java@v3 @@ -21,5 +24,5 @@ jobs: cache: maven - name: Build with Maven - working-directory: ./diylc + working-directory: ./diy-layout-creator/diylc run: mvn -B test \ No newline at end of file From 56cba5bd8c56d5391903cfc7d5bb5c008174234d Mon Sep 17 00:00:00 2001 From: Bane Stojkovic Date: Thu, 20 Mar 2025 21:33:25 +0100 Subject: [PATCH 4/8] fix tests --- diylc/.github/workflows/test.yml | 28 --------------- diylc/.github/workflows/tests.yml | 59 +++++++++---------------------- 2 files changed, 17 insertions(+), 70 deletions(-) delete mode 100644 diylc/.github/workflows/test.yml diff --git a/diylc/.github/workflows/test.yml b/diylc/.github/workflows/test.yml deleted file mode 100644 index 1282509d..00000000 --- a/diylc/.github/workflows/test.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Test Build - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - path: diy-layout-creator - - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - cache: maven - - - name: Build with Maven - working-directory: ./diy-layout-creator/diylc - run: mvn -B test \ No newline at end of file diff --git a/diylc/.github/workflows/tests.yml b/diylc/.github/workflows/tests.yml index f9d01b4d..e20f2197 100644 --- a/diylc/.github/workflows/tests.yml +++ b/diylc/.github/workflows/tests.yml @@ -1,51 +1,26 @@ -name: Java CI Tests +name: Test Build on: push: - branches: [ main ] + branches: [ "master" ] pull_request: - branches: [ main ] + branches: [ "master" ] jobs: - test: + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - name: Set up JDK - uses: actions/setup-java@v3 - with: - java-version: '11' # Adjust version as needed - distribution: 'temurin' - cache: maven - - - name: Run Tests - run: mvn test - - # Generate and report coverage without failing - - name: Generate Coverage Report - run: mvn jacoco:report - - - name: Report Coverage - run: | - COVERAGE=$(mvn jacoco:report | grep -oP 'Total coverage: \K[0-9.]+' || echo "unknown") - echo "Current test coverage: $COVERAGE%" - - - name: Upload Coverage Report - uses: actions/upload-artifact@v3 - with: - name: coverage-report - path: target/site/jacoco/ - - # Optional: Comment test results on PR - - name: Add Test Results Comment - uses: marocchino/sticky-pull-request-comment@v2 - if: github.event_name == 'pull_request' - with: - message: | - ### Test Results Summary - ✅ Tests completed - 📊 Coverage: ${{ env.COVERAGE }}% - - Coverage report available in workflow artifacts \ No newline at end of file + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + + - name: Build with Maven + working-directory: ./diylc + run: mvn -B test From 198ba445e0443d94d9e2086e5b8f13ab9b754642 Mon Sep 17 00:00:00 2001 From: Bane Stojkovic Date: Thu, 20 Mar 2025 21:36:41 +0100 Subject: [PATCH 5/8] Update tests.yml --- diylc/.github/workflows/tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/diylc/.github/workflows/tests.yml b/diylc/.github/workflows/tests.yml index e20f2197..124e8e78 100644 --- a/diylc/.github/workflows/tests.yml +++ b/diylc/.github/workflows/tests.yml @@ -22,5 +22,6 @@ jobs: cache: maven - name: Build with Maven - working-directory: ./diylc - run: mvn -B test + run: | + cd diylc + mvn -B test From 791a6b6bc41deedda7c1025f266ac908f1efad31 Mon Sep 17 00:00:00 2001 From: Bane Stojkovic Date: Thu, 20 Mar 2025 21:39:58 +0100 Subject: [PATCH 6/8] Update tests.yml --- .github/workflows/tests.yml | 61 +++++++++++-------------------------- 1 file changed, 18 insertions(+), 43 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8553a0fb..124e8e78 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,52 +1,27 @@ -name: Java CI Tests +name: Test Build on: push: - branches: [ master ] + branches: [ "master" ] pull_request: - branches: [ master ] + branches: [ "master" ] jobs: - test: + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - name: Set up JDK - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - cache: maven - - - name: Run Tests - run: mvn test - - # Generate and report coverage without failing - - name: Generate Coverage Report - run: mvn jacoco:report - - - name: Report Coverage - run: | - COVERAGE=$(mvn jacoco:report | grep -oP 'Total coverage: \K[0-9.]+' || echo "unknown") - echo "Current test coverage: $COVERAGE%" - - - name: Upload Coverage Report - uses: actions/upload-artifact@v4 - with: - name: coverage-report - path: target/site/jacoco/ - retention-days: 5 - - # Optional: Comment test results on PR - - name: Add Test Results Comment - uses: marocchino/sticky-pull-request-comment@v2 - if: github.event_name == 'pull_request' - with: - message: | - ### Test Results Summary - ✅ Tests completed - 📊 Coverage: ${{ env.COVERAGE }}% - - Coverage report available in workflow artifacts + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + + - name: Build with Maven + run: | + cd diylc + mvn -B test From 538c427627fa6d54c710ee51b62564ddd5975c2c Mon Sep 17 00:00:00 2001 From: Bane Stojkovic Date: Thu, 20 Mar 2025 21:40:18 +0100 Subject: [PATCH 7/8] test --- diylc/.github/workflows/tests.yml | 27 --------------------------- diylc/diylc-core/.project | 12 ++++++++++++ 2 files changed, 12 insertions(+), 27 deletions(-) delete mode 100644 diylc/.github/workflows/tests.yml diff --git a/diylc/.github/workflows/tests.yml b/diylc/.github/workflows/tests.yml deleted file mode 100644 index 124e8e78..00000000 --- a/diylc/.github/workflows/tests.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Test Build - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - cache: maven - - - name: Build with Maven - run: | - cd diylc - mvn -B test diff --git a/diylc/diylc-core/.project b/diylc/diylc-core/.project index f030609a..02064572 100644 --- a/diylc/diylc-core/.project +++ b/diylc/diylc-core/.project @@ -5,7 +5,19 @@ + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature From 1da5c6836bbeeeff4cecd576ea2bac7212e2a55b Mon Sep 17 00:00:00 2001 From: Bane Stojkovic Date: Thu, 20 Mar 2025 21:46:11 +0100 Subject: [PATCH 8/8] fix headless mode --- .../src/main/java/org/diylc/utils/Constants.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/diylc/diylc-core/src/main/java/org/diylc/utils/Constants.java b/diylc/diylc-core/src/main/java/org/diylc/utils/Constants.java index 7d71e266..61990f40 100644 --- a/diylc/diylc-core/src/main/java/org/diylc/utils/Constants.java +++ b/diylc/diylc-core/src/main/java/org/diylc/utils/Constants.java @@ -21,17 +21,15 @@ */ package org.diylc.utils; -import java.awt.BasicStroke; -import java.awt.Color; -import java.awt.Stroke; -import java.awt.Toolkit; +import java.awt.*; import org.diylc.core.Theme; public class Constants { public static final int PIXELS_PER_INCH = 200; - public static final double PIXEL_SIZE = 1d * PIXELS_PER_INCH / Toolkit.getDefaultToolkit().getScreenResolution(); + public static final double PIXEL_SIZE = 1d * PIXELS_PER_INCH / + (GraphicsEnvironment.isHeadless() ? 96 : Toolkit.getDefaultToolkit().getScreenResolution()); public static Color CANVAS_COLOR = Color.white;