Merge branch 'master' into feature/multimeter3

This commit is contained in:
Bane Stojkovic
2025-03-20 21:50:16 +01:00
5 changed files with 33 additions and 127 deletions
+16 -41
View File
@@ -1,52 +1,27 @@
name: Java CI Tests name: Test Build
on: on:
push: push:
branches: [ master ] branches: [ "master" ]
pull_request: pull_request:
branches: [ master ] branches: [ "master" ]
jobs: jobs:
test: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK - name: Set up JDK 17
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
java-version: '17' java-version: '17'
distribution: 'temurin' distribution: 'temurin'
cache: maven cache: maven
- name: Run Tests - name: Build with Maven
run: mvn test run: |
cd diylc
# Generate and report coverage without failing mvn -B test
- 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
-28
View File
@@ -1,28 +0,0 @@
name: Test Build
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- 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
run: |
cd diy-layout-creator/diylc
mvn -B test --file pom.xml
-51
View File
@@ -1,51 +0,0 @@
name: Java CI Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
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
+12
View File
@@ -5,7 +5,19 @@
<projects> <projects>
</projects> </projects>
<buildSpec> <buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures> </natures>
</projectDescription> </projectDescription>
@@ -21,17 +21,15 @@
*/ */
package org.diylc.utils; package org.diylc.utils;
import java.awt.BasicStroke; import java.awt.*;
import java.awt.Color;
import java.awt.Stroke;
import java.awt.Toolkit;
import org.diylc.core.Theme; import org.diylc.core.Theme;
public class Constants { public class Constants {
public static final int PIXELS_PER_INCH = 200; 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; public static Color CANVAS_COLOR = Color.white;