@@ -945,7 +945,7 @@ jobs:
945
945
- uses : dtolnay/rust-toolchain@master
946
946
with :
947
947
toolchain : ${{ matrix.job.toolchain }}
948
- components : rustfmt
948
+ components : rustfmt, llvm-tools-preview
949
949
- uses : taiki-e/install-action@nextest
950
950
- uses : taiki-e/install-action@grcov
951
951
- uses : Swatinem/rust-cache@v2
@@ -1000,6 +1000,7 @@ jobs:
1000
1000
# Update binutils if MinGW due to https://github.com/rust-lang/rust/issues/112368
1001
1001
windows-latest) C:/msys64/usr/bin/pacman.exe -Sy --needed mingw-w64-x86_64-gcc --noconfirm ; echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH ;;
1002
1002
esac
1003
+ mkdir -p ${{ vars.RUNNER_TEMP }}/target/debug
1003
1004
- name : Initialize toolchain-dependent workflow variables
1004
1005
id : dep_vars
1005
1006
shell : bash
@@ -1014,17 +1015,19 @@ jobs:
1014
1015
run : cargo nextest run --profile ci --hide-progress-bar ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} -p uucore -p coreutils
1015
1016
env :
1016
1017
RUSTC_WRAPPER : " "
1017
- RUSTFLAGS : " -Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
1018
+ RUSTFLAGS : " -Cprofile-generate=${{ vars.RUNNER_TEMP }}/target/debug -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
1018
1019
RUSTDOCFLAGS : " -Cpanic=abort"
1019
1020
RUST_BACKTRACE : " 1"
1021
+ LLVM_PROFILE_FILE : " coreutils-%p-%m.profraw"
1020
1022
# RUSTUP_TOOLCHAIN: ${{ steps.vars.outputs.TOOLCHAIN }}
1021
1023
- name : Test individual utilities
1022
1024
run : cargo nextest run --profile ci --hide-progress-bar ${{ steps.dep_vars.outputs.CARGO_UTILITY_LIST_OPTIONS }}
1023
1025
env :
1024
1026
RUSTC_WRAPPER : " "
1025
- RUSTFLAGS : " -Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
1027
+ RUSTFLAGS : " -Cprofile-generate=${{ vars.RUNNER_TEMP }}/target/debug -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
1026
1028
RUSTDOCFLAGS : " -Cpanic=abort"
1027
1029
RUST_BACKTRACE : " 1"
1030
+ LLVM_PROFILE_FILE : " coreutils-%p-%m.profraw"
1028
1031
# RUSTUP_TOOLCHAIN: ${{ steps.vars.outputs.TOOLCHAIN }}
1029
1032
- name : Generate coverage data (via `grcov`)
1030
1033
id : coverage
@@ -1037,9 +1040,9 @@ jobs:
1037
1040
# GRCOV_EXCLUDE_OPTION='--excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"' ## `grcov` ignores these params when passed as an environment variable (why?)
1038
1041
mkdir -p "${COVERAGE_REPORT_DIR}"
1039
1042
# display coverage files
1040
- grcov . --output-type files --ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()" | sort --unique
1043
+ grcov . --binary-path="${COVERAGE_REPORT_DIR}" -- output-type files --ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()" | sort --unique
1041
1044
# generate coverage report
1042
- grcov . --output-type lcov --output-path "${COVERAGE_REPORT_FILE}" --branch --ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"
1045
+ grcov . --binary-path="${COVERAGE_REPORT_DIR}" -- output-type lcov --output-path "${COVERAGE_REPORT_FILE}" --branch --ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"
1043
1046
echo "report=${COVERAGE_REPORT_FILE}" >> $GITHUB_OUTPUT
1044
1047
- name : Upload coverage results (to Codecov.io)
1045
1048
uses : codecov/codecov-action@v4
0 commit comments