Skip to content
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
4 changes: 3 additions & 1 deletion .github/workflows/test-coverage-report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ jobs:
just test-coverage coverage_target.out short
# switch back to the head ref
git checkout ${{ github.head_ref }}
./tools/bin/cov_compare.sh --no-header coverage_target.out coverage.out > table.txt
cat table.txt
{
echo 'coverage_report<<COVERAGE_REPORT_DELIM'
./tools/bin/cov_compare.sh --no-header coverage_target.out coverage.out
cat table.txt
echo 'COVERAGE_REPORT_DELIM'
} >> "$GITHUB_ENV"
- name: Remove previous coverage comments
Expand Down
9 changes: 6 additions & 3 deletions tools/bin/cov_compare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
# ./cov_compare.sh --no-header coverage.out coverage_new.out

NO_HEADER=0
ARGS=""

# Collect non-flag arguments in an array so they remain separate when
# resetting positional parameters with `set --`.
ARGS=()

# Parse optional flags
for arg in "$@"; do
Expand All @@ -17,13 +20,13 @@ for arg in "$@"; do
NO_HEADER=1
;;
*)
ARGS="$ARGS $arg"
ARGS+=("$arg")
;;
esac
done

# Reset positional parameters
set -- "$ARGS"
set -- "${ARGS[@]}"

if [ "$#" -ne 2 ]; then
echo "Usage: $0 [--no-header] coverage1.out coverage2.out" >&2
Expand Down
Loading