Skip to content

Commit 1d9e162

Browse files
authored
Merge pull request uutils#6856 from cakebaker/ci_remove_code_coverage_jobs
ci: remove code coverage jobs
2 parents 17fee51 + ca92bff commit 1d9e162

File tree

2 files changed

+0
-200
lines changed

2 files changed

+0
-200
lines changed

.github/workflows/CICD.yml

-126
Original file line numberDiff line numberDiff line change
@@ -925,132 +925,6 @@ jobs:
925925
name: toybox-result.json
926926
path: ${{ steps.vars.outputs.TEST_SUMMARY_FILE }}
927927

928-
coverage:
929-
name: Code Coverage
930-
runs-on: ${{ matrix.job.os }}
931-
timeout-minutes: 90
932-
env:
933-
SCCACHE_GHA_ENABLED: "true"
934-
RUSTC_WRAPPER: "sccache"
935-
strategy:
936-
fail-fast: false
937-
matrix:
938-
job:
939-
- { os: ubuntu-latest , features: unix, toolchain: nightly }
940-
- { os: macos-latest , features: macos, toolchain: nightly }
941-
# FIXME: Re-enable Code Coverage on windows, which currently fails due to "profiler_builtins". See #6686.
942-
# - { os: windows-latest , features: windows, toolchain: nightly-x86_64-pc-windows-gnu }
943-
steps:
944-
- uses: actions/checkout@v4
945-
- uses: dtolnay/rust-toolchain@master
946-
with:
947-
toolchain: ${{ matrix.job.toolchain }}
948-
components: rustfmt
949-
- uses: taiki-e/install-action@nextest
950-
- uses: taiki-e/install-action@grcov
951-
- uses: Swatinem/rust-cache@v2
952-
- name: Run sccache-cache
953-
uses: mozilla-actions/[email protected]
954-
# - name: Reattach HEAD ## may be needed for accurate code coverage info
955-
# run: git checkout ${{ github.head_ref }}
956-
- name: Initialize workflow variables
957-
id: vars
958-
shell: bash
959-
run: |
960-
## VARs setup
961-
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
962-
# toolchain
963-
TOOLCHAIN="nightly" ## default to "nightly" toolchain (required for certain required unstable compiler flags) ## !maint: refactor when stable channel has needed support
964-
# * specify gnu-type TOOLCHAIN for windows; `grcov` requires gnu-style code coverage data files
965-
case ${{ matrix.job.os }} in windows-*) TOOLCHAIN="$TOOLCHAIN-x86_64-pc-windows-gnu" ;; esac;
966-
# * use requested TOOLCHAIN if specified
967-
if [ -n "${{ matrix.job.toolchain }}" ]; then TOOLCHAIN="${{ matrix.job.toolchain }}" ; fi
968-
outputs TOOLCHAIN
969-
# target-specific options
970-
# * CARGO_FEATURES_OPTION
971-
CARGO_FEATURES_OPTION='--all-features' ; ## default to '--all-features' for code coverage
972-
if [ -n "${{ matrix.job.features }}" ]; then CARGO_FEATURES_OPTION='--features=${{ matrix.job.features }}' ; fi
973-
outputs CARGO_FEATURES_OPTION
974-
# * CODECOV_FLAGS
975-
CODECOV_FLAGS=$( echo "${{ matrix.job.os }}" | sed 's/[^[:alnum:]]/_/g' )
976-
outputs CODECOV_FLAGS
977-
- name: Install/setup prerequisites
978-
shell: bash
979-
run: |
980-
## Install/setup prerequisites
981-
case '${{ matrix.job.os }}' in
982-
macos-latest) brew install coreutils ;; # needed for testing
983-
esac
984-
case '${{ matrix.job.os }}' in
985-
ubuntu-latest)
986-
# pinky is a tool to show logged-in users from utmp, and gecos fields from /etc/passwd.
987-
# In GitHub Action *nix VMs, no accounts log in, even the "runner" account that runs the commands. The account also has empty gecos fields.
988-
# To work around this for pinky tests, we create a fake login entry for the GH runner account...
989-
FAKE_UTMP='[7] [999999] [tty2] [runner] [tty2] [] [0.0.0.0] [2022-02-22T22:22:22,222222+00:00]'
990-
# ... by dumping the login records, adding our fake line, then reverse dumping ...
991-
(utmpdump /var/run/utmp ; echo $FAKE_UTMP) | sudo utmpdump -r -o /var/run/utmp
992-
# ... and add a full name to each account with a gecos field but no full name.
993-
sudo sed -i 's/:,/:runner name,/' /etc/passwd
994-
# We also create a couple optional files pinky looks for
995-
touch /home/runner/.project
996-
echo "foo" > /home/runner/.plan
997-
;;
998-
esac
999-
case '${{ matrix.job.os }}' in
1000-
# Update binutils if MinGW due to https://github.com/rust-lang/rust/issues/112368
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-
esac
1003-
- name: Initialize toolchain-dependent workflow variables
1004-
id: dep_vars
1005-
shell: bash
1006-
run: |
1007-
## Dependent VARs setup
1008-
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
1009-
# * determine sub-crate utility list
1010-
UTILITY_LIST="$(./util/show-utils.sh ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }})"
1011-
CARGO_UTILITY_LIST_OPTIONS="$(for u in ${UTILITY_LIST}; do echo -n "-puu_${u} "; done;)"
1012-
outputs CARGO_UTILITY_LIST_OPTIONS
1013-
- name: Test
1014-
run: cargo nextest run --profile ci --hide-progress-bar ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} -p uucore -p coreutils
1015-
env:
1016-
RUSTC_WRAPPER: ""
1017-
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
1018-
RUSTDOCFLAGS: "-Cpanic=abort"
1019-
RUST_BACKTRACE: "1"
1020-
# RUSTUP_TOOLCHAIN: ${{ steps.vars.outputs.TOOLCHAIN }}
1021-
- name: Test individual utilities
1022-
run: cargo nextest run --profile ci --hide-progress-bar ${{ steps.dep_vars.outputs.CARGO_UTILITY_LIST_OPTIONS }}
1023-
env:
1024-
RUSTC_WRAPPER: ""
1025-
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
1026-
RUSTDOCFLAGS: "-Cpanic=abort"
1027-
RUST_BACKTRACE: "1"
1028-
# RUSTUP_TOOLCHAIN: ${{ steps.vars.outputs.TOOLCHAIN }}
1029-
- name: Generate coverage data (via `grcov`)
1030-
id: coverage
1031-
shell: bash
1032-
run: |
1033-
## Generate coverage data
1034-
COVERAGE_REPORT_DIR="target/debug"
1035-
COVERAGE_REPORT_FILE="${COVERAGE_REPORT_DIR}/lcov.info"
1036-
# GRCOV_IGNORE_OPTION='--ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*"' ## `grcov` ignores these params when passed as an environment variable (why?)
1037-
# GRCOV_EXCLUDE_OPTION='--excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"' ## `grcov` ignores these params when passed as an environment variable (why?)
1038-
mkdir -p "${COVERAGE_REPORT_DIR}"
1039-
# 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
1041-
# 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\()"
1043-
echo "report=${COVERAGE_REPORT_FILE}" >> $GITHUB_OUTPUT
1044-
- name: Upload coverage results (to Codecov.io)
1045-
uses: codecov/codecov-action@v4
1046-
with:
1047-
token: ${{ secrets.CODECOV_TOKEN }}
1048-
file: ${{ steps.coverage.outputs.report }}
1049-
## flags: IntegrationTests, UnitTests, ${{ steps.vars.outputs.CODECOV_FLAGS }}
1050-
flags: ${{ steps.vars.outputs.CODECOV_FLAGS }}
1051-
name: codecov-umbrella
1052-
fail_ci_if_error: false
1053-
1054928
test_separately:
1055929
name: Separate Builds
1056930
runs-on: ${{ matrix.os }}

.github/workflows/GnuTests.yml

-74
Original file line numberDiff line numberDiff line change
@@ -339,77 +339,3 @@ jobs:
339339
else
340340
echo "::warning ::Skipping test summary comparison; no prior reference summary is available."
341341
fi
342-
343-
gnu_coverage:
344-
name: Run GNU tests with coverage
345-
runs-on: ubuntu-24.04
346-
steps:
347-
- name: Checkout code uutil
348-
uses: actions/checkout@v4
349-
with:
350-
path: 'uutils'
351-
- name: Checkout GNU coreutils
352-
uses: actions/checkout@v4
353-
with:
354-
repository: 'coreutils/coreutils'
355-
path: 'gnu'
356-
ref: 'v9.5'
357-
submodules: recursive
358-
- uses: dtolnay/rust-toolchain@master
359-
with:
360-
toolchain: nightly
361-
components: rustfmt
362-
- uses: taiki-e/install-action@grcov
363-
- uses: Swatinem/rust-cache@v2
364-
with:
365-
workspaces: "./uutils -> target"
366-
- name: Install dependencies
367-
run: |
368-
## Install dependencies
369-
sudo apt-get update
370-
sudo apt-get install -y autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev libselinux1-dev attr
371-
- name: Add various locales
372-
run: |
373-
## Add various locales
374-
echo "Before:"
375-
locale -a
376-
## Some tests fail with 'cannot change locale (en_US.ISO-8859-1): No such file or directory'
377-
## Some others need a French locale
378-
sudo locale-gen
379-
sudo locale-gen --keep-existing fr_FR
380-
sudo locale-gen --keep-existing fr_FR.UTF-8
381-
sudo update-locale
382-
echo "After:"
383-
locale -a
384-
- name: Build binaries
385-
env:
386-
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
387-
RUSTDOCFLAGS: "-Cpanic=abort"
388-
run: |
389-
## Build binaries
390-
cd uutils
391-
bash util/build-gnu.sh
392-
- name: Run GNU tests
393-
run: bash uutils/util/run-gnu-test.sh
394-
- name: Generate coverage data (via `grcov`)
395-
id: coverage
396-
run: |
397-
## Generate coverage data
398-
cd uutils
399-
COVERAGE_REPORT_DIR="target/debug"
400-
COVERAGE_REPORT_FILE="${COVERAGE_REPORT_DIR}/lcov.info"
401-
mkdir -p "${COVERAGE_REPORT_DIR}"
402-
sudo chown -R "$(whoami)" "${COVERAGE_REPORT_DIR}"
403-
# display coverage files
404-
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
405-
# generate coverage report
406-
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\()"
407-
echo "report=${COVERAGE_REPORT_FILE}" >> $GITHUB_OUTPUT
408-
- name: Upload coverage results (to Codecov.io)
409-
uses: codecov/codecov-action@v4
410-
with:
411-
token: ${{ secrets.CODECOV_TOKEN }}
412-
file: ${{ steps.coverage.outputs.report }}
413-
flags: gnutests
414-
name: gnutests
415-
working-directory: uutils

0 commit comments

Comments
 (0)