@@ -945,7 +945,7 @@ jobs:
945945 - uses : dtolnay/rust-toolchain@master
946946 with :
947947 toolchain : ${{ matrix.job.toolchain }}
948- components : rustfmt
948+ components : rustfmt, llvm-tools-preview
949949 - uses : taiki-e/install-action@nextest
950950 - uses : taiki-e/install-action@grcov
951951 - uses : Swatinem/rust-cache@v2
@@ -1000,6 +1000,7 @@ jobs:
10001000 # Update binutils if MinGW due to https://github.com/rust-lang/rust/issues/112368
10011001 windows-latest) C:/msys64/usr/bin/pacman.exe -Sy --needed mingw-w64-x86_64-gcc --noconfirm ; echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH ;;
10021002 esac
1003+ mkdir -p ${{ vars.RUNNER_TEMP }}/target/debug
10031004 - name : Initialize toolchain-dependent workflow variables
10041005 id : dep_vars
10051006 shell : bash
@@ -1014,17 +1015,19 @@ jobs:
10141015 run : cargo nextest run --profile ci --hide-progress-bar ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} -p uucore -p coreutils
10151016 env :
10161017 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"
10181019 RUSTDOCFLAGS : " -Cpanic=abort"
10191020 RUST_BACKTRACE : " 1"
1021+ LLVM_PROFILE_FILE : " coreutils-%p-%m.profraw"
10201022 # RUSTUP_TOOLCHAIN: ${{ steps.vars.outputs.TOOLCHAIN }}
10211023 - name : Test individual utilities
10221024 run : cargo nextest run --profile ci --hide-progress-bar ${{ steps.dep_vars.outputs.CARGO_UTILITY_LIST_OPTIONS }}
10231025 env :
10241026 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"
10261028 RUSTDOCFLAGS : " -Cpanic=abort"
10271029 RUST_BACKTRACE : " 1"
1030+ LLVM_PROFILE_FILE : " coreutils-%p-%m.profraw"
10281031 # RUSTUP_TOOLCHAIN: ${{ steps.vars.outputs.TOOLCHAIN }}
10291032 - name : Generate coverage data (via `grcov`)
10301033 id : coverage
@@ -1037,9 +1040,9 @@ jobs:
10371040 # GRCOV_EXCLUDE_OPTION='--excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"' ## `grcov` ignores these params when passed as an environment variable (why?)
10381041 mkdir -p "${COVERAGE_REPORT_DIR}"
10391042 # 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
10411044 # 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\()"
10431046 echo "report=${COVERAGE_REPORT_FILE}" >> $GITHUB_OUTPUT
10441047 - name : Upload coverage results (to Codecov.io)
10451048 uses : codecov/codecov-action@v4
0 commit comments