Skip to content

Commit 6460d3e

Browse files
authored
Add GitHub issue/PR templates and CI workflow (#4)
Add bug report and feature request issue forms, a PR checklist template, and a CI workflow that builds+tests with GCC/Clang across Debug/Release, checks clang-format, and runs clang-tidy against the library headers (tests/examples excluded from tidy by design). Reformat EventDescriptorTests.cpp to satisfy the new clang-format check.
1 parent 7a20843 commit 6460d3e

6 files changed

Lines changed: 179 additions & 2 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Bug report
2+
description: Report unexpected or incorrect behavior in TickGuard
3+
labels: ["bug"]
4+
body:
5+
- type: textarea
6+
id: description
7+
attributes:
8+
label: Description
9+
description: What happened, and what did you expect instead?
10+
validations:
11+
required: true
12+
13+
- type: textarea
14+
id: repro
15+
attributes:
16+
label: Minimal reproduction
17+
description: Smallest code snippet or steps that trigger the issue. Include EventConfig/EventMode used, if relevant.
18+
render: cpp
19+
validations:
20+
required: true
21+
22+
- type: input
23+
id: version
24+
attributes:
25+
label: TickGuard commit / tag
26+
placeholder: e.g. 7a20843 or v1.2.0
27+
validations:
28+
required: true
29+
30+
- type: input
31+
id: compiler
32+
attributes:
33+
label: Compiler and version
34+
placeholder: e.g. GCC 14.2.0, Clang 18, MSVC 19.40
35+
validations:
36+
required: true
37+
38+
- type: input
39+
id: os
40+
attributes:
41+
label: OS / platform
42+
placeholder: e.g. Ubuntu 24.04, Debian 13, embedded target
43+
validations:
44+
required: false
45+
46+
- type: textarea
47+
id: logs
48+
attributes:
49+
label: Relevant logs / build output
50+
render: shell
51+
validations:
52+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Feature request
2+
description: Suggest new functionality or a behavior change for TickGuard
3+
labels: ["enhancement"]
4+
body:
5+
- type: textarea
6+
id: problem
7+
attributes:
8+
label: Problem
9+
description: What are you trying to do that TickGuard doesn't support today?
10+
validations:
11+
required: true
12+
13+
- type: textarea
14+
id: proposal
15+
attributes:
16+
label: Proposed solution
17+
description: >
18+
What would you like to change? Note that new EventMode/timing behavior should fit inside
19+
EventDescriptor's existing Debounce/Heartbeat phase machine rather than adding a parallel mechanism.
20+
validations:
21+
required: true
22+
23+
- type: textarea
24+
id: alternatives
25+
attributes:
26+
label: Alternatives considered
27+
validations:
28+
required: false

.github/pull_request_template.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Summary
2+
3+
<!-- What does this change do, and why? -->
4+
5+
## Related issue
6+
7+
<!-- Closes #... , if applicable -->
8+
9+
## Changes
10+
11+
-
12+
13+
## Testing
14+
15+
- [ ] `ctest --test-dir build --output-on-failure` passes locally
16+
- [ ] Added/updated tests covering this change
17+
- [ ] Ran `clang-format` / `clang-tidy` (or confirmed CI will)
18+
19+
## Checklist
20+
21+
- [ ] New timing/`EventMode` behavior (if any) lives inside `EventDescriptor`'s existing Debounce/Heartbeat phase machine, not a parallel mechanism
22+
- [ ] No `.cpp` files added to the library itself (header-only)
23+
- [ ] Documentation (`doc/developer-guide.md`, `README.md`, `AGENTS.md`) updated if architecture or usage changed

.github/workflows/ci.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
BUILD_DIR: build
11+
12+
jobs:
13+
build-and-test:
14+
name: build-and-test (${{ matrix.compiler }}, ${{ matrix.build_type }})
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
compiler: [gcc, clang]
20+
build_type: [Debug, Release]
21+
include:
22+
- compiler: gcc
23+
cc: gcc-13
24+
cxx: g++-13
25+
- compiler: clang
26+
cc: clang-18
27+
cxx: clang++-18
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Configure CMake
34+
env:
35+
CC: ${{ matrix.cc }}
36+
CXX: ${{ matrix.cxx }}
37+
run: >
38+
cmake -S . -B ${{ env.BUILD_DIR }}
39+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
40+
41+
- name: Build
42+
run: cmake --build ${{ env.BUILD_DIR }} --parallel
43+
44+
- name: Test
45+
run: ctest --test-dir ${{ env.BUILD_DIR }} --output-on-failure
46+
47+
format-check:
48+
name: clang-format
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
54+
- name: Check formatting
55+
run: |
56+
find include examples tests -name '*.hpp' -o -name '*.cpp' \
57+
| xargs clang-format-18 --dry-run --Werror
58+
59+
tidy-check:
60+
name: clang-tidy
61+
runs-on: ubuntu-latest
62+
steps:
63+
- name: Checkout
64+
uses: actions/checkout@v4
65+
66+
# Library headers only — tests and examples are excluded by design.
67+
- name: Run clang-tidy
68+
run: |
69+
status=0
70+
for f in $(find include -name '*.hpp'); do
71+
clang-tidy-18 "$f" -- -std=c++20 -Iinclude -pthread || status=1
72+
done
73+
exit $status

tests/EventDescriptorTests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ TEST_CASE("nextDeadline reflects the armed/disarmed state across OneShot and Int
201201
REQUIRE_FALSE(oneShot.nextDeadline().has_value());
202202

203203
EventDescriptor<bool> interval(EventId::ChannelLifeEthernet0,
204-
EventConfig{.mode = EventMode::Interval, .delay = 1000ms, .interval = 3000ms},
205-
sender, /*initial=*/false);
204+
EventConfig{.mode = EventMode::Interval, .delay = 1000ms, .interval = 3000ms}, sender,
205+
/*initial=*/false);
206206

207207
interval.trigger(EventValue{true});
208208
REQUIRE(interval.nextDeadline() == std::optional{1000ms});

0 commit comments

Comments
 (0)