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

General: Add codecov CI task #72

Merged
merged 3 commits into from
Jan 10, 2020
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<a href="https://dev.azure.com/patrickstotko/stdgpu/_build/latest?definitionId=3&branchName=master" alt="Build Status">
<img src="https://dev.azure.com/patrickstotko/stdgpu/_apis/build/status/stotko.stdgpu?branchName=master"/>
</a>
<a href="https://codecov.io/gh/stotko/stdgpu">
<img src="https://codecov.io/gh/stotko/stdgpu/branch/master/graph/badge.svg" />
</a>
<a href="https://stotko.github.io/stdgpu" alt="Documentation">
<img src="https://img.shields.io/badge/docs-doxygen-blue.svg"/>
</a>
Expand Down
56 changes: 55 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

steps:
- task: Bash@3
displayName: Install CMake 3.13+
displayName: Install CMake 3.15+
inputs:
targetType: 'inline'
script: |
Expand Down Expand Up @@ -103,3 +103,57 @@ jobs:
script: |
set -e
sh scripts/run_tests_$(BuildType).sh

- job:
displayName: Code Coverage OpenMP
pool:
vmImage: 'ubuntu-18.04'

steps:
- task: Bash@3
displayName: Install CMake 3.15+
inputs:
targetType: 'inline'
script: |
set -e
sh scripts/utils/install_cmake_ubuntu1804.sh

- task: Bash@3
displayName: Install lcov
inputs:
targetType: 'inline'
script: |
set -e
sh scripts/utils/install_lcov_ubuntu1804.sh

- task: Bash@3
displayName: Configure project
inputs:
targetType: 'inline'
script: |
set -e
sh scripts/ci/configure_openmp_lcov.sh

- task: Bash@3
displayName: Build project
inputs:
targetType: 'inline'
script: |
set -e
sh scripts/build_debug.sh

- task: Bash@3
displayName: Run coverage
inputs:
targetType: 'inline'
script: |
set -e
sh scripts/run_coverage.sh

- task: Bash@3
displayName: Upload coverage report
inputs:
targetType: 'inline'
script: |
set -e
bash <(curl -s https://codecov.io/bash) -f build/stdgpu_coverage.info
4 changes: 3 additions & 1 deletion cmake/code_coverage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ function(SETUP_TARGET_FOR_COVERAGE)
COMMAND ${LCOV_PATH} -a ${Coverage_NAME}.base -a ${Coverage_NAME}.info --output-file ${Coverage_NAME}.total
COMMAND ${LCOV_PATH} --remove ${Coverage_NAME}.total ${COVERAGE_EXCLUDES} --output-file ${PROJECT_BINARY_DIR}/${Coverage_NAME}.info.cleaned
COMMAND ${GENHTML_PATH} -o ${Coverage_NAME} ${PROJECT_BINARY_DIR}/${Coverage_NAME}.info.cleaned
COMMAND ${CMAKE_COMMAND} -E remove ${Coverage_NAME}.base ${Coverage_NAME}.total ${PROJECT_BINARY_DIR}/${Coverage_NAME}.info.cleaned
# Modification: Keep cleaned version
COMMAND ${CMAKE_COMMAND} -E remove ${Coverage_NAME}.base ${Coverage_NAME}.total ${PROJECT_BINARY_DIR}/${Coverage_NAME}.info
COMMAND ${CMAKE_COMMAND} -E rename ${PROJECT_BINARY_DIR}/${Coverage_NAME}.info.cleaned ${PROJECT_BINARY_DIR}/${Coverage_NAME}.info

WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
DEPENDS ${Coverage_DEPENDENCIES}
Expand Down
11 changes: 11 additions & 0 deletions scripts/ci/configure_openmp_lcov.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
set -e

# Create build directory
sh scripts/utils/create_empty_directory.sh build

# Download external dependencies
sh scripts/utils/download_dependencies.sh

# Configure project
sh scripts/utils/configure_debug.sh -DSTDGPU_BACKEND=STDGPU_BACKEND_OPENMP -DSTDGPU_BUILD_TEST_COVERAGE=ON -Dthrust_ROOT=external/thrust
6 changes: 6 additions & 0 deletions scripts/utils/install_lcov_ubuntu1804.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
set -e

# Install lcov
sudo apt-get update
sudo apt-get install lcov