mirror of
https://github.com/uutils/coreutils.git
synced 2026-05-06 07:26:38 -04:00
Avoid non reproducible cache generation at codcov (#10926)
This commit is contained in:
@@ -1116,26 +1116,22 @@ jobs:
|
||||
SCCACHE_GHA_ENABLED: "true"
|
||||
RUSTC_WRAPPER: "sccache"
|
||||
CARGO_INCREMENTAL: 0
|
||||
RUSTC_BOOTSTRAP: 1
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
job:
|
||||
- { os: ubuntu-latest , features: unix, toolchain: nightly }
|
||||
- { os: ubuntu-latest , features: unix }
|
||||
# FIXME: Re-enable macos code coverage
|
||||
# - { os: macos-latest , features: macos, toolchain: nightly }
|
||||
# - { os: macos-latest , features: macos }
|
||||
# FIXME: Re-enable Code Coverage on windows, which currently fails due to "profiler_builtins". See #6686.
|
||||
# - { os: windows-latest , features: windows, toolchain: nightly-x86_64-pc-windows-gnu }
|
||||
# - { os: windows-latest , features: windows, toolchain: stable-x86_64-pc-windows-gnu }
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: ${{ matrix.job.toolchain }}
|
||||
components: rustfmt
|
||||
- uses: taiki-e/install-action@v2
|
||||
with:
|
||||
tool: nextest,grcov@0.8.24
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Run sccache-cache
|
||||
uses: mozilla-actions/sccache-action@v0.0.9
|
||||
|
||||
@@ -1149,9 +1145,6 @@ jobs:
|
||||
## VARs setup
|
||||
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||
|
||||
# toolchain
|
||||
TOOLCHAIN="nightly" ## default to "nightly" toolchain (required for certain required unstable compiler flags) ## !maint: refactor when stable channel has needed support
|
||||
|
||||
# * specify gnu-type TOOLCHAIN for windows; `grcov` requires gnu-style code coverage data files
|
||||
case ${{ matrix.job.os }} in windows-*) TOOLCHAIN="$TOOLCHAIN-x86_64-pc-windows-gnu" ;; esac;
|
||||
|
||||
|
||||
@@ -41,10 +41,10 @@ REPO_main_dir="$(dirname -- "${ME_dir}")"
|
||||
FEATURES_OPTION=${FEATURES_OPTION:-"--features=feat_os_unix"}
|
||||
COVERAGE_DIR=${COVERAGE_DIR:-"${REPO_main_dir}/coverage"}
|
||||
|
||||
# Find llvm-profdata in the nightly toolchain (which is used for coverage builds)
|
||||
LLVM_PROFDATA="$(find "$(RUSTUP_TOOLCHAIN=nightly-gnu rustc --print sysroot)" -name llvm-profdata)"
|
||||
# Find llvm-profdata (which is used for coverage builds)
|
||||
LLVM_PROFDATA="$(find "$(rustc --print sysroot)" -name llvm-profdata)"
|
||||
if [ -z "${LLVM_PROFDATA}" ]; then
|
||||
echo "Error: llvm-profdata not found. Install it with: rustup +nightly-gnu component add llvm-tools"
|
||||
echo "Error: llvm-profdata not found. Install it with: rustup component add llvm-tools"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -60,10 +60,10 @@ rm -rf "${REPORT_DIR}" && mkdir -p "${REPORT_DIR}"
|
||||
#shellcheck disable=SC2086
|
||||
UTIL_LIST=$("${ME_dir}"/show-utils.sh ${FEATURES_OPTION})
|
||||
|
||||
export RUSTC_BOOTSTRAP=1
|
||||
export CARGO_INCREMENTAL=0
|
||||
export RUSTFLAGS="-Cinstrument-coverage -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
|
||||
export RUSTDOCFLAGS="-Cpanic=abort"
|
||||
export RUSTUP_TOOLCHAIN="nightly-gnu"
|
||||
export LLVM_PROFILE_FILE="${PROFRAW_DIR}/coverage-%4m.profraw"
|
||||
|
||||
# Disable expanded command printing for the rest of the program
|
||||
|
||||
Reference in New Issue
Block a user