diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index daac20e..ed5e6c9 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -36,13 +36,13 @@ runs: export B2_CI_VERSION=1 export B2_CXXSTD=20 export B2_VARIANT=debug - export B2_TARGETS=${{ github.targets }} + export B2_TARGETS="${{ inputs.targets }}" export B2_FLAGS="link=shared cxxflags=-fkeep-static-functions cxxflags=--coverage linkflags=--coverage" - export DRONE_BUILD_EVENT=${{ github.event_name }} + export DRONE_BUILD_EVENT="${{ github.event_name }}" export DRONE_JOB_BUILDTYPE=boost - export DRONE_COMMIT=${{ github.sha }} - export DRONE_BRANCH=${{ inputs.ref }} - export DRONE_REPO=${{ inputs.repo }} + export DRONE_COMMIT="${{ github.sha }}" + export DRONE_BRANCH="${{ inputs.ref }}" + export DRONE_REPO="${{ inputs.repo }}" cd ${{ inputs.path }} . .drone/drone.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 516345d..a929b30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: repository: booostorg/json ref: ${{ steps.fetch-target.outputs.ref }} commit: ${{ steps.fetch-target.outputs.commit }} - targets: libs/json/test + targets: libs/json/test libs/json/example libs/json/bench - id: fetch-baseline name: Fetch Boost.JSON baseline @@ -43,7 +43,7 @@ jobs: repository: booostorg/json ref: ${{ steps.fetch-baseline.outputs.ref }} commit: ${{ steps.fetch-baseline.outputs.commit }} - targets: libs/json/test + targets: libs/json/test libs/json/example libs/json/bench - name: Collect coverage run: | @@ -73,16 +73,16 @@ jobs: lcov --remove target/filter1.info '*/json/test/*' '*/json/bench/*' \ '*/json/example/*' --output-file target/filter2.info - git diff -U0 --no-indent-heuristic --minimal \ - base/boost-root/libs/json target/boost-root/libs/json >diff + git diff -U0 --no-indent-heuristic --minimal --no-index \ + base/boost-root/libs/json target/boost-root/libs/json | tee diff ./diff-coverage-report.py -O pages -S target/boost-root/libs/json \ -B base/filter2.info -T target/filter2.info -D diff \ -P $PWD/base/boost-root/boost $PWD/target/boost-root/libs/json/include/boost \ $PWD/target/boost-root/boost $PWD/target/boost-root/libs/json/include/boost \ $PWD/base/boost-root $PWD/target/boost-root \ - 1/base/boost-root $PWD/target/boost-root \ - 2/target/boost-root $PWD/target/boost-root + a/base/boost-root $PWD/target/boost-root \ + b/target/boost-root $PWD/target/boost-root - name: Save coverage info uses: actions/upload-artifact@v4 diff --git a/diff-coverage-report.py b/diff-coverage-report.py index e5b21e4..8f8e5c3 100755 --- a/diff-coverage-report.py +++ b/diff-coverage-report.py @@ -238,6 +238,11 @@ def commit(): elif l.startswith('+++ '): _, new_file = l.split(' ', 1) new_file = fix_path(new_file.rstrip(), prefix_map) + if old_file != new_file: + if old_file == '/dev/null': + old_file = new_file + elif new_file == '/dev/null': + new_file = old_file assert old_file == new_file file_data = result.get(new_file) @@ -249,8 +254,18 @@ def commit(): _, old_range, new_range, _ = l.split(' ', 3) assert old_range[0] == '-' assert new_range[0] == '+' - old_line, old_count = [int(x) for x in old_range[1:].split(',')] - new_line, new_count = [int(x) for x in new_range[1:].split(',')] + old_range = [int(x) for x in old_range[1:].split(',')] + if len(old_range) > 1: + old_line, old_count = old_range + else: + old_line = old_range[0] + old_count = 1 + new_range = [int(x) for x in new_range[1:].split(',')] + if len(new_range) > 1: + new_line, new_count = new_range + else: + new_line = new_range[0] + new_count = 1 elif l.startswith(' '): old_line += 1