Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code coverage workflow #20

Merged
merged 61 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
b55f277
Add draft of code_coverage.yml
sbaldu Oct 19, 2023
feddf8f
Refactor test files and update CMake workflow
Grufoony Nov 17, 2023
8c6994d
Merge branch 'main' into feature_code_coverage
Grufoony Nov 19, 2023
93e6d7b
Add test directory to CMakeLists.txt
Grufoony Nov 19, 2023
ec724e0
Update test execution command
Grufoony Nov 19, 2023
80ad6d6
Update working directory for code coverage
Grufoony Nov 19, 2023
7fedbfd
Add test/data subdirectory
Grufoony Nov 19, 2023
73e2178
Add copy of test/data folder for tests
Grufoony Nov 19, 2023
3ea248a
Update file copy destination in CMakeLists.txt
Grufoony Nov 19, 2023
4bcd88f
Update file path for code coverage report
Grufoony Nov 19, 2023
49927c6
Include valgrind degub files in gitignore
sbaldu Nov 18, 2023
dcb1352
Combine all tests executable into a unique one (#63)
Grufoony Nov 18, 2023
5d961ea
Update include paths in benchmark cmake files (#67)
sbaldu Nov 19, 2023
ee8953c
Create workflow for benchmarks (#69)
sbaldu Nov 19, 2023
469e1a2
Fix insertion of nodes with `addNode` (#68)
sbaldu Nov 19, 2023
4e9d915
Update submodules
sbaldu Nov 20, 2023
7004a94
Add nodes to nodeSet when using `addStreet` (#65)
sbaldu Nov 20, 2023
6c639a5
Remove reference in variadic methods template constraint (#66)
sbaldu Nov 20, 2023
176d2e7
Add `insert_and_expand` function to SparseMatrix (#72)
Grufoony Nov 23, 2023
077e1d9
Enhance exceptions (#75)
Grufoony Nov 23, 2023
2822d12
Add some agent utilities (#76)
Grufoony Nov 25, 2023
e866c84
Implement Dijkstra algorithm (#73)
sbaldu Nov 28, 2023
6ecf49c
Add queue managemnet in Node class (#77)
Grufoony Nov 29, 2023
4f838d6
Reworked Itinerary Id (#78)
Grufoony Dec 2, 2023
08a96d1
Changed `index` into `id` (#79)
Grufoony Dec 2, 2023
4d39830
Add optional streetId parameter to Agent (#80)
Grufoony Dec 4, 2023
5efb299
Remove unused header file (#84)
Grufoony Dec 7, 2023
e4d6132
Refactor `importAdj` function to `importMatrix` (#85)
Grufoony Dec 8, 2023
402820b
Feature import nodes and edges from csv (#86)
Grufoony Dec 8, 2023
526055f
Remove codacy workflow (#55)
Grufoony Dec 15, 2023
7373529
Fix function for finding shortest paths (#89)
sbaldu Dec 15, 2023
ae5f159
chenged Doxyfile output directories (#95)
Grufoony Dec 15, 2023
53b4051
Add Doxygen Action workflow (#97)
Grufoony Dec 16, 2023
33ffc43
Pylint action run (#98)
Grufoony Dec 16, 2023
f1ef933
Implement dynamics (#81)
Grufoony Dec 19, 2023
11f3645
Remove unused docs fodler (#102)
Grufoony Dec 19, 2023
1fc936e
Add optional parameter to getRow and getCol functions (#91)
Grufoony Dec 19, 2023
0da0c5a
Refactor test files and update CMake workflow
Grufoony Nov 17, 2023
1fec531
Merge branch 'main' into feature_code_coverage
Grufoony Dec 20, 2023
625ff26
fix
Grufoony Dec 21, 2023
4b887cb
guess who's back
Grufoony Dec 21, 2023
1e3159a
Merge branch 'main' into feature_code_coverage
Grufoony Sep 10, 2024
a847537
Update code_coverage workflow
Grufoony Sep 10, 2024
38298e9
Update code_coverage workflow
Grufoony Sep 10, 2024
d501fae
again
Grufoony Sep 10, 2024
64b15d8
Rewrite CMake config
Grufoony Sep 10, 2024
cd83992
Try to implement coverage into tests
Grufoony Sep 10, 2024
2db7e29
Fix path
Grufoony Sep 10, 2024
a5f3b04
Set build to DEBUG
Grufoony Sep 10, 2024
c35abf9
Change output file format to xml
Grufoony Sep 10, 2024
aa81478
Change coverage file search path
Grufoony Sep 10, 2024
eafb9c0
Remove code_coverage workflow: it is now incorporated in tests
Grufoony Sep 10, 2024
bdd3d6d
Update checkout action
Grufoony Sep 10, 2024
6b010ba
Add codecov badge to README
sbaldu Sep 11, 2024
8602066
Update codecov-action version
sbaldu Sep 11, 2024
6fcd64a
Get token from repo secrets
sbaldu Sep 11, 2024
6fd44f8
fix
sbaldu Sep 11, 2024
c976943
try
sbaldu Sep 11, 2024
ffa1c48
Update cmake_test.yml
sbaldu Sep 11, 2024
a19384c
Add env variable
sbaldu Sep 11, 2024
ca0f04a
Cleaning
sbaldu Sep 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions .github/workflows/cmake_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,24 @@ on:
branches: [ "main" ]

env:
BUILD_TYPE: Release
BUILD_TYPE: Debug

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Update apt repo
run: sudo apt-get update

- name: Install tools manually
run: sudo apt-get install lcov gcovr

- uses: actions/checkout@v4

- name: Configure CMake
working-directory: ${{github.workspace}}/test
run: cmake -B ${{github.workspace}}/test/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
run: cmake -DTEST=ON -DCODE_COVERAGE=ON -B ${{github.workspace}}/test/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
working-directory: ${{github.workspace}}/test
Expand All @@ -28,3 +34,15 @@ jobs:
- name: Run tests
working-directory: ${{github.workspace}}/test
run: ./dsm_tests.out

- name: create Report
working-directory: ${{github.workspace}}/test
run: lcov --capture --directory .. --output-file coverage.xml

- uses: codecov/codecov-action@v3.1.4
with:
#token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
file: ${{github.workspace}}/test/coverage.xml # optional
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# DynamicalSystemFramework
[![codecov](https://codecov.io/github/sbaldu/DynamicalSystemFramework/graph/badge.svg?token=JV53J6IUJ3)](https://codecov.io/github/sbaldu/DynamicalSystemFramework)

The aim of this project is to rework the original [Traffic Flow Dynamics Model](https://github.com/Grufoony/TrafficFlowDynamicsModel).
This rework consists of a full code rewriting, in order to implement more features (like *intersections*) and get advantage from the latest C++ updates.
Expand Down
8 changes: 6 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# Set the C++ flags
string(APPEND CMAKE_CXX_FLAGS "-Wall -Wextra -O3 -g")
# Add code coverage options
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
message(STATUS "Enable code coverage")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -g --coverage")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
endif()

# Set the folder for the executable
set(EXECUTABLE_OUTPUT_PATH ../)
Expand Down
Loading