Skip to content

Commit

Permalink
Merge branch 'OpenEMS:develop' into feature/meter-tibber
Browse files Browse the repository at this point in the history
  • Loading branch information
Sn0w3y committed Jul 3, 2024
2 parents 5578b31 + 7b6e982 commit 874ed6d
Show file tree
Hide file tree
Showing 272 changed files with 14,825 additions and 4,261 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ updates:
interval: weekly
open-pull-requests-limit: 10
target-branch: develop
- package-ecosystem: "github-actions"
directory: "/.github/workflows"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
target-branch: develop
50 changes: 15 additions & 35 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,53 +22,28 @@ jobs:

- uses: kiancross/checkstyle-annotations-action@v1

- name: Checkstyle
run: ./gradlew checkstyleAll --console=plain --warn

- name: Build all Java packages
run: ./gradlew build
run: ./gradlew build --console=plain --warn

- name: Resolve OpenEMS bundles
run: ./gradlew resolve
run: ./gradlew resolve --console=plain --warn

- name: Validate BackendApp.bndrun
run: git diff --exit-code io.openems.backend.application/BackendApp.bndrun

- name: Validate EdgeApp.bndrun
run: git diff --exit-code io.openems.edge.application/EdgeApp.bndrun

#
# Generate Code-coverage-report
#
- name: Generate JaCoCo Code-coverage-report
run: ./gradlew jacocoTestReport

- name: Summarize JaCoCo Report
id: jacoco
uses: cicirello/jacoco-badge-generator@v2
with:
jacoco-csv-file: 'io.openems.*/generated/reports/jacoco/**/*.csv'
generate-coverage-badge: false

- name: Create JaCoCo Badge
env:
PR_NUMBER: ${{ github.event.number }}
run: |
coverage=$(echo "scale=2; ${{ steps.jacoco.outputs.coverage }} * 100" | bc | cut -c1-4);

color=red;
if (( $(echo "$coverage > 90" | bc -l) )); then
color=success;
elif (( $(echo "$coverage > 80" | bc -l) )); then
color=green;
elif (( $(echo "$coverage > 60" | bc -l) )); then
color=yellow;
fi;
mkdir -p ./jacoco
echo $PR_NUMBER > ./jacoco/jacoco_report_number
echo '![Code Coverage]'"(https://img.shields.io/badge/Code%20Coverage-${coverage}%25-${color}?style=flat)" > ./jacoco/jacoco_report_badge
- uses: actions/upload-artifact@v4
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
name: jacoco_report
path: jacoco/
token: ${{ secrets.CODECOV_TOKEN }}

build-ui:
runs-on: ubuntu-latest
Expand All @@ -92,10 +67,15 @@ jobs:
- name: Build OpenEMS UI
run: |
cd ui
npm install
npm ci --prefer-offline --cache ~/.npm
node_modules/.bin/ng config cli.cache.path "~/.ng"
node_modules/.bin/ng build -c "openems,openems-edge-prod,prod"
node_modules/.bin/ng lint
export CHROME_BIN=/usr/bin/google-chrome-stable
npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI
npm run test -- --code-coverage --no-watch --no-progress --browsers=ChromeHeadlessCI
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
directory: ./ui/
token: ${{ secrets.CODECOV_TOKEN }}
50 changes: 0 additions & 50 deletions .github/workflows/comment.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
type=raw,value=develop,enable=${{ github.ref == 'refs/heads/develop' }}
- name: Build and push Docker images
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
file: ${{ matrix.dockerfile }}
platforms: linux/amd64, linux/arm64
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: ./gradlew buildAntoraDocs --continue

- name: Deploy to GitHub pages
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.DOCS }}
external_repository: OpenEMS/openems.io
Expand Down
32 changes: 19 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ jobs:

- uses: kiancross/checkstyle-annotations-action@v1

- name: Checkstyle
run: ./gradlew checkstyleAll --console=plain --warn

- name: Build all Java packages
run: ./gradlew build
run: ./gradlew build --console=plain --warn

- name: Resolve OpenEMS bundles
run: ./gradlew resolve
run: ./gradlew resolve --console=plain --warn

- name: Validate BackendApp.bndrun
run: git diff --exit-code io.openems.backend.application/BackendApp.bndrun
Expand All @@ -33,12 +36,12 @@ jobs:
run: git diff --exit-code io.openems.edge.application/EdgeApp.bndrun

- name: Prepare Edge+Backend assets
run: ./gradlew buildEdge buildBackend
run: ./gradlew buildEdge buildBackend --console=plain --warn

- name: Save build-artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
name: java-build-artifacts
path: |
build/openems-edge.jar
build/openems-backend.jar
Expand All @@ -65,7 +68,6 @@ jobs:
- name: Build OpenEMS UI
run: |
cd ui
npm install
npm ci --prefer-offline --cache ~/.npm
node_modules/.bin/ng config cli.cache.path "~/.ng"
node_modules/.bin/ng build -c "openems,openems-edge-prod,prod"
Expand All @@ -75,24 +77,28 @@ jobs:
- name: Prepare UI asset
run: |
mkdir build
cd ui/target
zip -r ../../build/openems-ui.zip ./*
tar --xz --transform 's|^ui/target|openems-ui|' -cvf openems-ui.tar.xz ui/target/
- name: Save build-artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: build/openems-ui.zip
name: ui-build-artifacts
path: openems-ui.tar.xz

release:
runs-on: ubuntu-latest
needs: [build-java, build-ui]
steps:
- name: Load build-artifacts
- name: Load Java build-artifacts
uses: actions/download-artifact@v4
with:
name: java-build-artifacts
path: build

- name: Load UI build-artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
name: ui-build-artifacts
path: build

- name: Create draft Release
Expand All @@ -102,4 +108,4 @@ jobs:
files: |
build/openems-edge.jar
build/openems-backend.jar
build/openems-ui.zip
build/openems-ui.tar.xz
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![Build Status](https://github.com/OpenEMS/openems/actions/workflows/build.yml/badge.svg)](https://github.com/OpenEMS/openems/actions/workflows/build.yml)
[![Gitpod live-demo](https://img.shields.io/badge/Gitpod-live--demo-blue?logo=gitpod)](https://gitpod.io/#https://github.com/OpenEMS/openems/tree/main)
[![Cite via Zenodo](https://zenodo.org/badge/DOI/10.5281/zenodo.4440884.svg)](https://doi.org/10.5281/zenodo.4440883)
[![codecov](https://codecov.io/gh/openems/openems/graph/badge.svg?token=xliIughqt1)](https://codecov.io/gh/openems/openems)

<h1 align="center">
<img src="./doc/modules/ROOT/assets/images/OpenEMS-Logo.png" alt="the Feneco - OpenEMS Logo" width="200"></a>
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ subprojects {
jacocoTestReport {
reports {
xml.required = true
csv.required = true
csv.required = false
html.required = false
}
// Exclude com.dalsemi.onewire
Expand All @@ -80,8 +80,8 @@ subprojects {
html.required = false
sarif.required = false
}
minHeapSize = "256m"
maxHeapSize = "1g"
minHeapSize = "512m"
maxHeapSize = "2048m"
// Exclude com.dalsemi.onewire
exclude '**/com/dalsemi/onewire/*'
}
Expand Down
13 changes: 9 additions & 4 deletions cnf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<dependency>
<!-- Bnd Gradle Plugin For The Bnd Workspace -->
<!-- On update: also update gradle.properties file -->
<groupId>biz.aQute.bnd.workspace</groupId>
<artifactId>biz.aQute.bnd.workspace.gradle.plugin</artifactId>
<groupId>biz.aQute.bnd</groupId>
<artifactId>biz.aQute.bnd.gradle</artifactId>
<version>7.0.0</version>
</dependency>
<!-- com -->
Expand Down Expand Up @@ -208,7 +208,7 @@
<!-- Changelog: https://github.com/apache/felix-dev/commits/master/http -->
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.http.jetty</artifactId>
<version>5.1.16</version>
<version>5.1.22</version>
</dependency>
<dependency>
<!-- Apache Felix Servlet API -->
Expand Down Expand Up @@ -242,7 +242,7 @@
<!-- Changelog: https://github.com/apache/felix-dev/blob/master/webconsole/README.md#releases -->
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.webconsole</artifactId>
<version>5.0.2</version>
<version>5.0.4</version>
</dependency>
<dependency>
<!-- Apache Felix Web Console Service Component Runtime/Declarative Services Plugin -->
Expand All @@ -267,6 +267,11 @@
<artifactId>fastexcel</artifactId>
<version>0.18.0</version>
</dependency>
<dependency>
<groupId>org.dhatim</groupId>
<artifactId>fastexcel-reader</artifactId>
<version>0.18.0</version>
</dependency>
<dependency>
<!-- Eclipse Paho MQTTv5 Client -->
<groupId>org.eclipse.paho</groupId>
Expand Down
16 changes: 16 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
coverage:
round: up
precision: 2
status:
project:
default:
target: auto
threshold: 10%

comment:
layout: "condensed_header, diff"
behavior: default
require_changes: false
require_base: false
require_head: true
hide_project_coverage: true
2 changes: 1 addition & 1 deletion doc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

node {
nodeModulesDir = file("${projectDir}/build")
nodeProjectDir = file("${projectDir}/build")
}

/*
Expand Down
2 changes: 1 addition & 1 deletion doc/build/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/mode_modules/
/node_modules/
/www/
4 changes: 2 additions & 2 deletions doc/build/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "openems-doc",
"version": "1.0.0",
"dependencies": {
"antora": "^3.1.6"
"devDependencies": {
"antora": "^3.1.8"
}
}
Binary file modified doc/build/uibundle_openems.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions doc/modules/ROOT/pages/edge/deploy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This guide covers a simple, manual approach. For productive systems it is requir
Prerequisites:
* A target device running Debian Linux like a Raspberry Pi, Beaglebone Black or an IoT gateway. You need the IP address and SSH access.
* Create a JAR-file that should be deployes. See xref:edge/build.adoc[Build OpenEMS Edge] for details. Alternatively you may download the latest release `openems-edge.jar` file from https://github.com/OpenEMS/openems/releases[GitHub] under _Assets_.
* Create a JAR-file that should be deployed. See xref:edge/build.adoc[Build OpenEMS Edge] for details. Alternatively you may download the latest release `openems-edge.jar` file from https://github.com/OpenEMS/openems/releases[GitHub] under _Assets_.
* Setup an SSH client to connect to the Linux console, e.g. http://www.9bis.net/kitty/[KiTTY]
* Setup an SCP client to copy the JAR file via SSH, e.g. https://winscp.net/eng/docs/lang:de[WinSCP]
Expand Down Expand Up @@ -132,4 +132,4 @@ Execute `systemctl restart openems --no-block; journalctl -lfu openems`
The command restarts the service (_systemctl restart openems_) while not waiting for the OpenEMS startup notification (_--no-block_). Then it directly prints the OpenEMS system log (_journalctl -lfu openems_).
+
.OpenEMS Edge start-up
image::deploy-openems-start.png[OpenEMS Edge start-up]
image::deploy-openems-start.png[OpenEMS Edge start-up]
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ maven.repo.local=cnf
org.gradle.caching=true
org.gradle.parallel=false
org.gradle.workers.max=1
org.gradle.jvmargs=-Xms256m -Xmx512m "-XX:MaxMetaspaceSize=256m"
org.gradle.jvmargs=-Xms512m -Xmx2048m "-XX:MaxMetaspaceSize=512m"
Loading

0 comments on commit 874ed6d

Please sign in to comment.