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

Update CI/CD #296

Merged
merged 11 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions .github/workflows/Code_Coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@ jobs:
- uses: actions/checkout@v2

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build sudo apt-get install lcov gcovr
run: cmake -DTEST=ON -DCODE_COVERAGE=ON -B ${{github.workspace}}/build; sudo apt-get install lcov gcovr

- 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: ./test/test_exe
working-directory: ${{github.workspace}}/build/test
run: ./test_exe

- name: create Report
working-directory: ${{github.workspace}}/build
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: ./build/coverage.info # optional
file: ${{github.workspace}}/build/test/coverage.info # optional
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
8 changes: 4 additions & 4 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 -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
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

13 changes: 11 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,17 @@ jobs:

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
#- name: Autobuild
# uses: github/codeql-action/autobuild@v2

- 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 -DEXAMPLES=ON -DBENCHMARK=ON -B ${{github.workspace}}/build

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

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand Down
4 changes: 3 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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*)
endif(TEST)
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