mirror of
https://github.com/SFML/SFML.git
synced 2024-11-24 20:31:05 +08:00
Replaced Codecov with Coveralls.
This commit is contained in:
parent
6eaf300918
commit
90fb07066b
40
.github/.codecov.yml
vendored
40
.github/.codecov.yml
vendored
@ -1,40 +0,0 @@
|
|||||||
codecov:
|
|
||||||
require_ci_to_pass: yes
|
|
||||||
|
|
||||||
coverage:
|
|
||||||
precision: 2
|
|
||||||
round: down
|
|
||||||
range: "70...100"
|
|
||||||
status:
|
|
||||||
project:
|
|
||||||
default:
|
|
||||||
target: auto
|
|
||||||
threshold: 100%
|
|
||||||
base: auto
|
|
||||||
if_ci_failed: success
|
|
||||||
informational: true
|
|
||||||
patch:
|
|
||||||
default:
|
|
||||||
target: auto
|
|
||||||
threshold: 100%
|
|
||||||
base: auto
|
|
||||||
if_ci_failed: success
|
|
||||||
informational: true
|
|
||||||
|
|
||||||
parsers:
|
|
||||||
gcov:
|
|
||||||
branch_detection:
|
|
||||||
conditional: yes
|
|
||||||
loop: yes
|
|
||||||
method: no
|
|
||||||
macro: no
|
|
||||||
|
|
||||||
comment:
|
|
||||||
layout: "reach,diff,flags,files,footer"
|
|
||||||
behavior: default
|
|
||||||
require_changes: no
|
|
||||||
require_head: no
|
|
||||||
require_base: no
|
|
||||||
|
|
||||||
github_checks:
|
|
||||||
annotations: false
|
|
26
.github/workflows/ci.yml
vendored
26
.github/workflows/ci.yml
vendored
@ -205,16 +205,15 @@ jobs:
|
|||||||
gcovr -r $GITHUB_WORKSPACE -x build/coverage.out -s -f 'src/SFML/.*' -f 'include/SFML/.*' ${{ matrix.platform.gcovr_options }} $GITHUB_WORKSPACE
|
gcovr -r $GITHUB_WORKSPACE -x build/coverage.out -s -f 'src/SFML/.*' -f 'include/SFML/.*' ${{ matrix.platform.gcovr_options }} $GITHUB_WORKSPACE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Upload Coverage Report to Codecov
|
- name: Upload Coverage Report to Coveralls
|
||||||
uses: codecov/codecov-action@v4
|
|
||||||
if: matrix.type.name == 'Debug' && github.repository == 'SFML/SFML' # Disable upload in forks
|
if: matrix.type.name == 'Debug' && github.repository == 'SFML/SFML' # Disable upload in forks
|
||||||
|
uses: coverallsapp/github-action@v2
|
||||||
with:
|
with:
|
||||||
fail_ci_if_error: false
|
file: ./build/coverage.out
|
||||||
name: ${{ matrix.platform.name }} ${{ matrix.config.name }} ${{ matrix.type.name }}
|
flag-name: ${{ matrix.platform.name }} ${{ matrix.config.name }} ${{ matrix.type.name }}
|
||||||
directory: ./build
|
parallel: true
|
||||||
files: ./build/coverage.out
|
allow-empty: true
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
base-path: ${{ github.workspace }}
|
||||||
verbose: true
|
|
||||||
|
|
||||||
- name: Test Install Interface
|
- name: Test Install Interface
|
||||||
if: matrix.platform.name != 'Android'
|
if: matrix.platform.name != 'Android'
|
||||||
@ -222,6 +221,17 @@ jobs:
|
|||||||
cmake -S test/install -B test/install/build -DSFML_ROOT=build/install -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=${{ matrix.type.name == 'Debug' && 'Debug' || 'Release' }} ${{matrix.platform.flags}} ${{matrix.config.flags}} ${{matrix.type.flags}}
|
cmake -S test/install -B test/install/build -DSFML_ROOT=build/install -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=${{ matrix.type.name == 'Debug' && 'Debug' || 'Release' }} ${{matrix.platform.flags}} ${{matrix.config.flags}} ${{matrix.type.flags}}
|
||||||
cmake --build test/install/build --config ${{ matrix.type.name == 'Debug' && 'Debug' || 'Release' }}
|
cmake --build test/install/build --config ${{ matrix.type.name == 'Debug' && 'Debug' || 'Release' }}
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
name: Finalize Coverage Upload
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Coveralls Finished
|
||||||
|
uses: coverallsapp/github-action@v2
|
||||||
|
with:
|
||||||
|
parallel-finished: true
|
||||||
|
|
||||||
format:
|
format:
|
||||||
name: Formatting
|
name: Formatting
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
@ -180,12 +180,28 @@ if(SFML_ENABLE_COVERAGE AND OpenCppCoverage_FOUND)
|
|||||||
string(REPLACE "/" "\\" COVERAGE_SRC "${PROJECT_SOURCE_DIR}/src")
|
string(REPLACE "/" "\\" COVERAGE_SRC "${PROJECT_SOURCE_DIR}/src")
|
||||||
string(REPLACE "/" "\\" COVERAGE_INCLUDE "${PROJECT_SOURCE_DIR}/include")
|
string(REPLACE "/" "\\" COVERAGE_INCLUDE "${PROJECT_SOURCE_DIR}/include")
|
||||||
|
|
||||||
set(COVERAGE_PREFIX ${OpenCppCoverage_BINARY} ARGS --quiet --export_type cobertura:${PROJECT_BINARY_DIR}/coverage.out --cover_children --excluded_modules "${COVERAGE_EXCLUDE}" --sources "${COVERAGE_SRC}" --sources "${COVERAGE_INCLUDE}" --)
|
# We need to patch the OpenCppCoverage output to remove path prefixes so Coveralls doesn't get confused
|
||||||
|
cmake_path(GET PROJECT_SOURCE_DIR ROOT_NAME COVERAGE_ROOT_NAME)
|
||||||
|
string(REPLACE "/" "\\\\" COVERAGE_PATH_PREFIX "${PROJECT_SOURCE_DIR}/")
|
||||||
|
string(REPLACE "${COVERAGE_ROOT_NAME}\\\\" "" COVERAGE_PATH_PREFIX "${COVERAGE_PATH_PREFIX}")
|
||||||
|
|
||||||
|
file(WRITE "${PROJECT_BINARY_DIR}/patch_coverage.cmake"
|
||||||
|
"file(READ \"${PROJECT_BINARY_DIR}/coverage.out\" COVERAGE_OUT)\n\
|
||||||
|
string(REPLACE \"${COVERAGE_PATH_PREFIX}\" \"\" COVERAGE_OUT \"\${COVERAGE_OUT}\")\n\
|
||||||
|
string(REPLACE \"${COVERAGE_ROOT_NAME}\" \".\" COVERAGE_OUT \"\${COVERAGE_OUT}\")\n\
|
||||||
|
file(WRITE \"${PROJECT_BINARY_DIR}/coverage.out\" \"\${COVERAGE_OUT}\")\n")
|
||||||
|
|
||||||
|
set(COVERAGE_PREFIX ${OpenCppCoverage_BINARY} --quiet --export_type cobertura:${PROJECT_BINARY_DIR}/coverage.out --cover_children --excluded_modules "${COVERAGE_EXCLUDE}" --sources "${COVERAGE_SRC}" --sources "${COVERAGE_INCLUDE}" --)
|
||||||
|
else()
|
||||||
|
# On all other systems, we just run an empty script
|
||||||
|
file(WRITE "${PROJECT_BINARY_DIR}/patch_coverage.cmake" "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Convenience for building and running tests in a single command
|
# Convenience for building and running tests in a single command
|
||||||
add_custom_target(runtests DEPENDS test-sfml-system test-sfml-window test-sfml-graphics test-sfml-network test-sfml-audio)
|
add_custom_target(runtests DEPENDS test-sfml-system test-sfml-window test-sfml-graphics test-sfml-network test-sfml-audio)
|
||||||
add_custom_command(TARGET runtests
|
add_custom_command(TARGET runtests
|
||||||
COMMENT "Run tests"
|
COMMENT "Run tests"
|
||||||
POST_BUILD COMMAND ${COVERAGE_PREFIX} ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>
|
POST_BUILD
|
||||||
|
COMMAND ${COVERAGE_PREFIX} ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>
|
||||||
|
COMMAND ${CMAKE_COMMAND} -P "${PROJECT_BINARY_DIR}/patch_coverage.cmake"
|
||||||
VERBATIM)
|
VERBATIM)
|
||||||
|
Loading…
Reference in New Issue
Block a user