systemstats: Consider discharge cap in remaining time calculation #133
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-License-Identifier: BSD-2-Clause | |
# | |
# SPDX-FileCopyrightText: 2023 Kai Uwe Broulik <ghqalpha@broulik.de> | |
name: Builds and Tests | |
on: ["push", "pull_request"] | |
jobs: | |
build-and-test-library: | |
strategy: | |
matrix: | |
config: | |
- {name: "Ubuntu 22.04 (GCC)", os: "ubuntu-22.04", CC: "gcc", CXX: "g++"} | |
#- {name: "Ubuntu 22.04 (Clang)", os: "ubuntu-22.04", CC: "clang", CXX: "clang++"} | |
name: ${{matrix.config.name}} | |
runs-on: ${{matrix.config.os}} | |
steps: | |
- name: Install dependencies | |
env: | |
DEBIAN_FRONTEND: "noninteractive" | |
run: sudo apt-get update && sudo apt-get install -y build-essential cmake qtbase5-dev extra-cmake-modules lcov | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Configure | |
env: | |
CC: ${{matrix.config.CC}} | |
CXX: ${{matrix.config.CXX}} | |
BUILD_DIR: "build/" | |
run: | | |
cmake -B ${BUILD_DIR} -DBUILD_TESTING=ON -DBUILD_COVERAGE=ON -DBUILD_QML=OFF -DBUILD_KSYSTEMSTATS=OFF -DBUILD_KINFOCENTER=OFF | |
- name: Build | |
env: | |
CC: ${{matrix.config.CC}} | |
CXX: ${{matrix.config.CXX}} | |
BUILD_DIR: "build/" | |
run: | | |
MAKEFLAGS=-j$(nproc) cmake --build ${BUILD_DIR} | |
- name: XDG Base Dirs | |
run: | | |
mkdir -p "$HOME/.qttest/cache" | |
mkdir -p "$HOME/.qttest/config" | |
- name: Test | |
env: | |
CC: ${{matrix.config.CC}} | |
CXX: ${{matrix.config.CXX}} | |
BUILD_DIR: "build/" | |
run: | | |
ctest --test-dir ${BUILD_DIR} -V | |
- name: Generate Coverage Report | |
env: | |
CC: ${{matrix.config.CC}} | |
CXX: ${{matrix.config.CXX}} | |
BUILD_DIR: "build/" | |
run: | | |
lcov --capture --directory ${BUILD_DIR}src/lib --output-file ${BUILD_DIR}coverage.info | |
lcov --remove ${BUILD_DIR}coverage.info -o ${BUILD_DIR}coverage.info '/usr/*' '*/moc_*' | |
if: matrix.config.CC == 'gcc' | |
# TODO upload report somewhere, add a badge to the README, etc. | |
build-full: | |
strategy: | |
matrix: | |
config: | |
- {name: "Ubuntu 22.04 (GCC)", os: "ubuntu-22.04", CC: "gcc", CXX: "g++"} | |
#- {name: "Ubuntu 22.04 (Clang)", os: "ubuntu-22.04", CC: "clang", CXX: "clang++"} | |
name: ${{matrix.config.name}} | |
runs-on: ${{matrix.config.os}} | |
steps: | |
- name: Install dependencies | |
env: | |
DEBIAN_FRONTEND: "noninteractive" | |
run: sudo apt-get update && sudo apt-get install -y build-essential cmake qtbase5-dev qtdeclarative5-dev qtquickcontrols2-5-dev extra-cmake-modules libkf5coreaddons-dev libkf5declarative-dev libkf5sysguard-dev libsensors-dev | |
# TODO libsensors should be pulled in by KSystemStats... | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Configure | |
env: | |
CC: ${{matrix.config.CC}} | |
CXX: ${{matrix.config.CXX}} | |
BUILD_DIR: "build/" | |
run: | | |
cmake -B ${BUILD_DIR} -DBUILD_EXAMPLES=ON -DBUILD_TESTING=OFF | |
- name: Build | |
env: | |
CC: ${{matrix.config.CC}} | |
CXX: ${{matrix.config.CXX}} | |
BUILD_DIR: "build/" | |
run: | | |
MAKEFLAGS=-j$(nproc) cmake --build ${BUILD_DIR} | |
build-presentation: | |
strategy: | |
matrix: | |
config: | |
- {name: "Ubuntu 22.04 (GCC)", os: "ubuntu-22.04", CC: "gcc", CXX: "g++"} | |
#- {name: "Ubuntu 22.04 (Clang)", os: "ubuntu-22.04", CC: "clang", CXX: "clang++"} | |
name: ${{matrix.config.name}} | |
runs-on: ${{matrix.config.os}} | |
steps: | |
- name: Install dependencies | |
env: | |
DEBIAN_FRONTEND: "noninteractive" | |
run: sudo apt-get update && sudo apt-get install -y build-essential cmake qtbase5-dev qtdeclarative5-dev qtquickcontrols2-5-dev extra-cmake-modules libkf5coreaddons-dev libkf5declarative-dev libkf5sysguard-dev libsensors-dev | |
# TODO libsensors should be pulled in by KSystemStats... | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Configure | |
env: | |
CC: ${{matrix.config.CC}} | |
CXX: ${{matrix.config.CXX}} | |
BUILD_DIR: "build/" | |
run: | | |
cmake -B ${BUILD_DIR} -DBUILD_EXAMPLES=ON -DBUILD_TESTING=OFF -DPRESENTATION_BUILD=ON | |
- name: Build | |
env: | |
CC: ${{matrix.config.CC}} | |
CXX: ${{matrix.config.CXX}} | |
BUILD_DIR: "build/" | |
run: | | |
MAKEFLAGS=-j$(nproc) cmake --build ${BUILD_DIR} |