Skip to content

Commit 6a6f36f

Browse files
authored
[Feature] Changing CMake Presets and Defaults for CMake options (#115)
* This allows us to build shared and static libraries * changing default options for cmake * Updating the CI * Make sure we build and then test * fixing the README badge * addressing PR comments
1 parent 6095dd1 commit 6a6f36f

8 files changed

Lines changed: 253 additions & 292 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

.github/workflows/coverage.yml

Lines changed: 44 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,53 @@
1-
name: Code Coverage
1+
---
2+
name: Respond Code Coverage
3+
# Schema: https://json.schemastore.org/github-action.json
24

35
on:
4-
push:
5-
branches: [ "main" ]
6-
pull_request:
7-
branches: [ "main" ]
6+
push:
7+
branches: ["main"]
8+
pull_request:
9+
branches: ["main"]
810

911
jobs:
10-
build:
11-
name: ubuntu-latest, Debug
12-
runs-on: ubuntu-latest
13-
steps:
14-
- name: Checkout Respond Repository
15-
uses: actions/checkout@v4
12+
build:
13+
name: Calculate Code Coverage
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Respond Repository
17+
uses: actions/checkout@v4
1618

17-
- name: Install Boost
18-
uses: MarkusJx/install-boost@v2.4.5
19-
id: install-boost
20-
with:
21-
boost_version: 1.86.0
22-
platform_version: 22.04
19+
- name: Install gcovr
20+
run: pip install gcovr
2321

24-
- name: Install Eigen3
25-
uses: kupns-aka-kupa/setup-eigen3@master
26-
id: install-eigen3
27-
with:
28-
version: 3.4.0
29-
env:
30-
CMAKE_GENERATOR: Ninja
22+
- name: Install Eigen3
23+
uses: kupns-aka-kupa/setup-eigen3@master
24+
id: install-eigen3
25+
with:
26+
version: 3.4.0
27+
env:
28+
CMAKE_GENERATOR: Ninja
3129

32-
- name: Configure Project
33-
env:
34-
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
35-
EIGEN3_INCLUDE_DIR: ${{ steps.install-eigen3.outputs.EIGEN3_INCLUDE_DIR }}
36-
EIGEN3_DIR: ${{ steps.install-eigen3.outputs.EIGEN3_DIR}}
37-
run: >
38-
cmake
39-
-B ${{github.workspace}}/build
40-
-D RESPOND_BUILD_PIC=ON -D RESPOND_BUILD_EXECUTABLE=OFF -D RESPOND_BUILD_TESTS=ON -D RESPOND_CALCULATE_COVERAGE=ON -D RESPOND_BUILD_BENCH=OFF -D RESPOND_BUILD_WARNINGS=ON -D RESPOND_BUILD_SHARED_LIBS=OFF -D CMAKE_BUILD_TYPE:STRING=Debug
30+
- name: Configure Project
31+
env:
32+
EIGEN3_INCLUDE_DIR: ${{ steps.install-eigen3.outputs.EIGEN3_INCLUDE_DIR }}
33+
EIGEN3_DIR: ${{ steps.install-eigen3.outputs.EIGEN3_DIR}}
34+
run: >
35+
cmake --preset debug-gcc-linux-shared-config
4136
42-
- name: Build Project
43-
run: >
44-
cmake
45-
--build ${{github.workspace}}/build
46-
--config Debug
37+
- name: Build Project
38+
run: >
39+
cmake --build --preset debug-gcc-linux-shared-build
4740
48-
- name: Run Tests
49-
run: |
50-
./build/tests/respond_tests
51-
52-
- name: Check Test Coverage
53-
uses: threeal/gcovr-action@v1.1.0
54-
with:
55-
working-directory: ${{github.workspace}}
56-
excludes: |
57-
Eigen3/*
58-
boost/*
59-
datamanagement/*
60-
gtest/*
61-
googletest/*
62-
build/*
63-
fail-under-line: 80
64-
html-out: coverage.html
65-
html-details: true
66-
html-title: TESPOND Test Coverage Report
67-
html-theme: github.green
41+
- name: Test Project
42+
run: >
43+
cmake --build --preset debug-gcc-linux-shared-build --target test
44+
45+
- name: Generate gcovr report
46+
run: |
47+
gcovr -r . --xml-pretty -o coverage.xml
48+
49+
- name: Generate Coverage Badge
50+
uses: GaelGirodon/ci-badges-action@v1
51+
with:
52+
gist-id: 10e746e28df5d23e91689b01493435a0
53+
token: ${{secrets.GIST_BADGE_TOKEN}}

.github/workflows/test-ubuntu.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/test-windows.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/unit-testing.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Respond Unit Testing
2+
# Schema: https://json.schemastore.org/github-action.json
3+
4+
on:
5+
push:
6+
branches: ["main"]
7+
pull_request:
8+
branches: ["main"]
9+
10+
jobs:
11+
unit-testing:
12+
name: Testing ${{matrix.os}} ${{matrix.build-variant}} build
13+
runs-on: ${{matrix.os}}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest]
17+
build-variant: [shared, static]
18+
steps:
19+
- name: Checkout Respond Repository
20+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
21+
22+
- name: Install Eigen3
23+
uses: kupns-aka-kupa/setup-eigen3@master
24+
id: install-eigen3
25+
with:
26+
version: 3.4.0
27+
env:
28+
CMAKE_GENERATOR: Ninja
29+
30+
- name: Configure Project
31+
env:
32+
EIGEN3_INCLUDE_DIR: ${{ steps.install-eigen3.outputs.EIGEN3_INCLUDE_DIR }}
33+
EIGEN3_DIR: ${{ steps.install-eigen3.outputs.EIGEN3_DIR}}
34+
run: >
35+
cmake --preset debug-gcc-linux-${{matrix.build-variant}}-config
36+
37+
- name: Run Testing Workflow
38+
run: >
39+
cmake --workflow --preset test-debug-gcc-linux-${{matrix.build-variant}}-workflow

0 commit comments

Comments
 (0)