Skip to content

Commit 6b1e063

Browse files
committed
Run cicd via cmake
1 parent 39b1aa4 commit 6b1e063

3 files changed

Lines changed: 25 additions & 3 deletions

File tree

‎.github/workflows/ccpp.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v2
16-
- name: make check
17-
run: make check
15+
- uses: actions/checkout@v4
16+
- name: Configure
17+
run: cmake -B build -DBM8563_BUILD_TESTS=ON
18+
- name: Build
19+
run: cmake --build build
20+
- name: Test
21+
run: ctest --test-dir build --output-on-failure

‎README.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,15 @@ while (1) {
163163
164164
```
165165

166+
## Run unit tests
167+
168+
```
169+
$ mkdir build && cd build
170+
$ cmake -DBM8563_BUILD_TESTS=ON ..
171+
$ make
172+
$ ctest
173+
```
174+
166175

167176
## License
168177

‎tests/CMakeLists.txt‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
add_executable(unit unit.c mock_i2c.c)
2+
target_link_libraries(unit PRIVATE bm8563)
3+
target_compile_options(unit PRIVATE
4+
-Wmissing-declarations
5+
-Wmissing-prototypes
6+
-Wstrict-prototypes
7+
)
8+
9+
add_test(NAME unit COMMAND unit)

0 commit comments

Comments
 (0)