v0.2.1: run tests in CI, add REUSE compliance and CONTRIBUTING

- Add .github/workflows/test.yml, using flatpak-builder's run-tests
  option so PRs and pushes exercise ctest inside the same KDE SDK
  sandbox as release builds.
- Add REUSE.toml covering files that can't carry an inline SPDX header
  (.desktop, keys/*.asc, screenshots/*).
- Add CONTRIBUTING.md documenting build/test/release steps.
This commit is contained in:
2026-07-03 12:06:40 -05:00
parent 5f37debd01
commit a657287bd1
6 changed files with 109 additions and 2 deletions
+39
View File
@@ -0,0 +1,39 @@
# SPDX-License-Identifier: GPL-3.0-or-later
name: Build and Test
on:
pull_request: {}
push:
branches:
- main
jobs:
test:
name: Build and run tests
runs-on: ubuntu-latest
container:
# Ships the KDE Platform/Sdk + flatpak-builder. Bump the tag to match
# runtime-version in the manifest.
image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.10
options: --privileged
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build from the checked-out commit
run: |
python3 - <<'PY'
import re
p = "io.github.toservetheking.FlatKontrol.yml"
s = open(p).read()
s = re.sub(r" sources:.*\Z",
" sources:\n - type: dir\n path: .\n",
s, flags=re.S)
open(p, "w").write(s)
print(s)
PY
- name: Build and run tests
run: |
flatpak-builder --user --disable-rofiles-fuse --force-clean \
builddir io.github.toservetheking.FlatKontrol.yml
+1 -1
View File
@@ -3,7 +3,7 @@
cmake_minimum_required(VERSION 3.16) cmake_minimum_required(VERSION 3.16)
project(flatkontrol VERSION 0.2.0 LANGUAGES CXX) project(flatkontrol VERSION 0.2.1 LANGUAGES CXX)
set(REQUIRED_QT_VERSION 6.6.0) set(REQUIRED_QT_VERSION 6.6.0)
set(REQUIRED_KF_VERSION 6.5.0) set(REQUIRED_KF_VERSION 6.5.0)
+45
View File
@@ -0,0 +1,45 @@
# Contributing to FlatKontrol
## Build
FlatKontrol is a KDE/Kirigami application (C++20 + QML) built with CMake
and Extra CMake Modules. See the README for the full list of system
packages to install, then:
```sh
cmake -B build -G Ninja
cmake --build build
./build/bin/flatkontrol
```
## Test
```sh
ctest --test-dir build --output-on-failure
```
Tests live in `autotests/` and link the core logic directly out of `src/`
(see `autotests/CMakeLists.txt`). CI runs the same suite on every pull
request via `.github/workflows/test.yml`, using `flatpak-builder`'s
`run-tests` option so the run happens inside the same KDE SDK sandbox as
release builds.
## Conventions
- Every source file starts with `SPDX-License-Identifier: GPL-3.0-or-later`
(in whatever comment syntax fits the file type). Files that can't carry
an inline header — `.desktop`, `keys/*.asc`, `screenshots/*` — are
covered instead by `REUSE.toml`.
- `src/` is intentionally flat: one class per concern, no `models/`,
`controllers/`, or `viewmodels/` subfolders. See the README's
"Architecture" section for what each class owns.
- C++ backend classes are exposed to QML via `QML_ELEMENT`; QML views are
meant to stay thin renderers over that state, not hold logic themselves.
## Releasing
`.github/workflows/build.yml` builds, signs, and publishes a Flatpak
bundle whenever a `v*` tag is pushed. To cut a release: bump
`project(... VERSION ...)` in `CMakeLists.txt`, add a matching `<release>`
entry to the metainfo file, update the manifest's pinned `tag:`, then tag
and push.
+13
View File
@@ -0,0 +1,13 @@
version = 1
SPDX-PackageName = "FlatKontrol"
SPDX-PackageSupplier = "ToServeTheKing <[email protected]>"
SPDX-PackageDownloadLocation = "https://github.com/toservetheking/FlatKontrol"
[[annotations]]
path = [
"io.github.toservetheking.FlatKontrol.desktop",
"keys/*.asc",
"screenshots/*",
]
SPDX-License-Identifier = "GPL-3.0-or-later"
SPDX-FileCopyrightText = "ToServeTheKing <[email protected]>"
@@ -61,6 +61,15 @@
<content_rating type="oars-1.1"/> <content_rating type="oars-1.1"/>
<releases> <releases>
<release version="0.2.1" date="2026-07-03">
<description>
<ul>
<li>Run the test suite in CI on every pull request</li>
<li>Add REUSE license-compliance metadata</li>
<li>Add a CONTRIBUTING guide</li>
</ul>
</description>
</release>
<release version="0.2.0" date="2026-07-01"> <release version="0.2.0" date="2026-07-01">
<description> <description>
<ul> <ul>
+2 -1
View File
@@ -32,11 +32,12 @@ modules:
buildsystem: cmake-ninja buildsystem: cmake-ninja
config-opts: config-opts:
- -DCMAKE_BUILD_TYPE=Release - -DCMAKE_BUILD_TYPE=Release
run-tests: true
sources: sources:
# For Flathub / release builds, pin to a tag AND commit: # For Flathub / release builds, pin to a tag AND commit:
- type: git - type: git
url: https://github.com/toservetheking/FlatKontrol.git url: https://github.com/toservetheking/FlatKontrol.git
tag: v0.2.0 tag: v0.2.1
# commit: <fill in the exact commit SHA the tag points at> # commit: <fill in the exact commit SHA the tag points at>
# #
# For local testing before the repo is pushed, replace the source above with: # For local testing before the repo is pushed, replace the source above with: