diff --git a/.travis.yml b/.travis.yml index 54efeaa..b7fa90a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -140,7 +140,6 @@ install: fi export BOOST_CI=$PWD/boost-ci - git clone https://github.com/boostorg/boost-ci.git $BOOST_CI - - cp $BOOST_CI/.codecov.yml . # Workaround - cp -pr $BOOST_CI/ci . - echo "build-project test ;" > Jamfile.v2 diff --git a/appveyor.yml b/appveyor.yml index 8ef46dd..c1f080b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,8 +6,6 @@ version: 1.0.{build}-{branch} -shallow_clone: true - branches: only: - master @@ -30,6 +28,8 @@ environment: B2_LINK: shared,static # B2_THREADING: threading=multi,single B2_VARIANT: release,debug + # Include OpenCppCoverage and git bash (avoid WSL bash) + PATH: 'C:\Program Files\OpenCppCoverage;C:\Program Files\Git\bin;%PATH%' matrix: - FLAVOR: Visual Studio 2019 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 @@ -106,6 +106,10 @@ environment: configuration: Debug BOOST_ROOT: C:\Libraries\boost_1_71_0 CMAKE: true + COVERAGE: true + # Work around for https://community.codecov.io/t/bash-script-does-not-detect-appveyor/1094 + APPVEYOR: true + CI: true install: - set SELF=%APPVEYOR_PROJECT_NAME:-=_% @@ -165,6 +169,15 @@ for: test_script: - ctest --output-on-failure -C %configuration% --parallel 4 + - ps: | + If ($env:COVERAGE -eq "true") { + choco install opencppcoverage + Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh + OpenCppCoverage.exe --quiet --export_type cobertura:cobertura.xml ` + --sources ${env:APPVEYOR_BUILD_FOLDER} --modules "$PWD" ` + --cover_children --working_dir "$PWD" -- ctest -C Debug + bash codecov.sh -f cobertura.xml -n Appveyor -e APPVEYOR_BUILD_WORKER_IMAGE -X gcov -X search -Z + } # Build consumer example test - cmake --build . --config %configuration% --target install - del /F /S /Q * diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..4986738 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,8 @@ +codecov: + max_report_age: off + require_ci_to_pass: yes + notify: + after_n_builds: 2 + wait_for_ci: yes +comment: + layout: "diff, files"