From d6eaac18841ce38b42b305d417a4b315cb996838 Mon Sep 17 00:00:00 2001 From: Kai J <99220919+da-Kai@users.noreply.github.com> Date: Mon, 1 Jul 2024 11:14:23 +0200 Subject: [PATCH 1/2] CI: add Codecov for UI (#2693) --- .github/workflows/build.yml | 8 +++++++- codecov.yml | 3 ++- ui/karma.conf.js | 6 +++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8211dc2cec2..a67813b0d63 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,4 +70,10 @@ jobs: 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 \ No newline at end of file + npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4 + with: + directory: ./ui/ + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/codecov.yml b/codecov.yml index 1f9dcb53ef3..00b2350eb74 100644 --- a/codecov.yml +++ b/codecov.yml @@ -4,7 +4,8 @@ coverage: status: project: default: - target: auto #default + target: auto + threshold: 10% comment: layout: "condensed_header, diff" diff --git a/ui/karma.conf.js b/ui/karma.conf.js index 65647d92cac..0980006d7ec 100644 --- a/ui/karma.conf.js +++ b/ui/karma.conf.js @@ -5,6 +5,9 @@ module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', '@angular-devkit/build-angular'], + preprocessor: { + 'src/**/*.ts': ['coverage'] + }, plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), @@ -28,11 +31,12 @@ module.exports = function (config) { dir: require('path').join(__dirname, './coverage/ngv'), subdir: '.', reporters: [ + {type: 'lcov'}, { type: 'html' }, { type: 'text-summary' } ], }, - reporters: ['progress', 'kjhtml'], + reporters: ['progress', 'kjhtml', 'coverage'], port: 9876, colors: true, logLevel: config.LOG_INFO, From 30b35800ac5d976017d252097fa27c3a71be6fe6 Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Mon, 1 Jul 2024 11:43:33 +0200 Subject: [PATCH 2/2] Push version to 2024.7.0 --- io.openems.common/src/io/openems/common/OpenemsConstants.java | 2 +- ui/package-lock.json | 4 ++-- ui/package.json | 2 +- ui/src/app/changelog/view/component/changelog.constants.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/io.openems.common/src/io/openems/common/OpenemsConstants.java b/io.openems.common/src/io/openems/common/OpenemsConstants.java index 28910dcf23c..848265f9c22 100644 --- a/io.openems.common/src/io/openems/common/OpenemsConstants.java +++ b/io.openems.common/src/io/openems/common/OpenemsConstants.java @@ -36,7 +36,7 @@ public class OpenemsConstants { /** * The additional version string. */ - public static final String VERSION_STRING = "SNAPSHOT"; + public static final String VERSION_STRING = ""; /** * The complete version as a SemanticVersion. diff --git a/ui/package-lock.json b/ui/package-lock.json index 2fb7e864c4f..b38f652d904 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -1,12 +1,12 @@ { "name": "openems-ui", - "version": "2024.7.0-SNAPSHOT", + "version": "2024.7.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "openems-ui", - "version": "2024.7.0-SNAPSHOT", + "version": "2024.7.0", "license": "AGPL-3.0", "dependencies": { "@angular/animations": "~16.2.12", diff --git a/ui/package.json b/ui/package.json index 4107030261c..cf51861bf7d 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,6 +1,6 @@ { "name": "openems-ui", - "version": "2024.7.0-SNAPSHOT", + "version": "2024.7.0", "license": "AGPL-3.0", "private": true, "dependencies": { diff --git a/ui/src/app/changelog/view/component/changelog.constants.ts b/ui/src/app/changelog/view/component/changelog.constants.ts index fec1a68180b..1341682b050 100644 --- a/ui/src/app/changelog/view/component/changelog.constants.ts +++ b/ui/src/app/changelog/view/component/changelog.constants.ts @@ -2,7 +2,7 @@ import { Role } from "src/app/shared/type/role"; export class Changelog { - public static readonly UI_VERSION = "2024.7.0-SNAPSHOT"; + public static readonly UI_VERSION = "2024.7.0"; public static product(...products: Product[]) { return products.map(product => Changelog.link(product.name, product.url)).join(", ") + '. ';