mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12:09 +10:00
Merge branch 'master' into feature/mirror2
This commit is contained in:
+16
-44
@@ -1,55 +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
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
working-directory: diylc
|
|
||||||
|
|
||||||
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: diylc/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
|
|
||||||
|
|||||||
Vendored
-28
@@ -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
|
|
||||||
Vendored
-51
@@ -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
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>diylc-core</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
|
</natures>
|
||||||
|
</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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user