Skip to content

Commit

Permalink
updated CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ZigRazor authored May 15, 2023
1 parent f767ef6 commit f0015d1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/Code_Coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@ jobs:

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build -j
run: cmake --build ${{github.workspace}}/build

- name: run
working-directory: ${{github.workspace}}/build
run: ${{github.workspace}}/build/test/test_exe
working-directory: ${{github.workspace}}/build/test
run: ./test_exe

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

- uses: codecov/codecov-action@v3.1.3
with:
#token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
file: ${{github.workspace}}/build/build/coverage.info # optional
file: ${{github.workspace}}/build/coverage.info # optional
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
6 changes: 3 additions & 3 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ jobs:
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -DTEST=ON -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
run: cmake -DTEST=ON -B ${{github.workspace}}/build

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j
run: cmake --build ${{github.workspace}}/build

- name: Test
working-directory: ${{github.workspace}}/build/test
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}}
run: ctest -C

4 changes: 3 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if(TEST)

set(SAVE_CMAKE_POSITION_INDEPENDENT_CODE ${CMAKE_POSITION_INDEPENDENT_CODE})
set(CMAKE_POSITION_INDEPENDENT_CODE True)
#FetchContent_MakeAvailable(zlib)
FetchContent_MakeAvailable(zlib)
set(CMAKE_POSITION_INDEPENDENT_CODE ${SAVE_CMAKE_POSITION_INDEPENDENT_CODE})

file (GLOB TEST_FILES "*.cpp" "*.hpp")
Expand All @@ -58,6 +58,7 @@ if(TEST)
PUBLIC ${zlib_SOURCE_DIR}
)
target_link_libraries(test_exe
PUBLIC pthread
PUBLIC GTest::gtest_main
PUBLIC zlibstatic
)
Expand All @@ -81,4 +82,5 @@ if(TEST)
add_test(test_kosaraju test_exe --gtest_filter=TestKosaraju*)
add_test(test_bestfirstsearch test_exe --gtest_filter=BestFirstSearch*)
add_test(test_kahn test_exe --gtest_filter=Kahn*)
add_test(test_DOT test_exe --gtest_filter=DOTTest*)
endif(TEST)
6 changes: 3 additions & 3 deletions test/DOTTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ TEST(DOTTest, WriteToDotMixed) {

TEST(DOTTest, ReadFromDotUndirected) {
CXXGraph::Graph<int> graph;
graph.readFromDotFile("..", "test_dot_undirected");
graph.readFromDotFile("../../test", "test_dot_undirected");

// Check that the graph is undirected
ASSERT_EQ(graph.isDirectedGraph(), false);
Expand All @@ -87,7 +87,7 @@ TEST(DOTTest, ReadFromDotUndirected) {

TEST(DOTTest, ReadFromDotUndirectedWeighted) {
CXXGraph::Graph<int> graph;
graph.readFromDotFile("..", "test_dot_weighted");
graph.readFromDotFile("../../test", "test_dot_weighted");

// Check that the graph is undirected
ASSERT_EQ(graph.isDirectedGraph(), false);
Expand Down Expand Up @@ -117,7 +117,7 @@ TEST(DOTTest, ReadFromDotUndirectedWeighted) {

TEST(DOTTest, ReadFromDotDirected) {
CXXGraph::Graph<int> graph;
graph.readFromDotFile("..", "test_dot_directed");
graph.readFromDotFile("../../test", "test_dot_directed");

// Check that the graph is undirected
ASSERT_EQ(graph.isDirectedGraph(), true);
Expand Down

0 comments on commit f0015d1

Please sign in to comment.