diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 290c1648d5d..234d41d72e0 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -2,7 +2,7 @@ name: GnuTests # spell-checker:ignore (abbrev/names) CodeCov gnulib GnuTests Swatinem # spell-checker:ignore (jargon) submodules devel -# spell-checker:ignore (libs/utils) autopoint chksum getenforce gperf lcov libexpect limactl pyinotify setenforce shopt texinfo valgrind libattr libcap taiki-e +# spell-checker:ignore (libs/utils) autopoint chksum getenforce getlimits gperf lcov libexpect limactl pyinotify setenforce shopt texinfo valgrind libattr libcap taiki-e # spell-checker:ignore (options) Ccodegen Coverflow Cpanic Zpanic # spell-checker:ignore (people) Dawid Dziurla * dawidd dtolnay # spell-checker:ignore (vars) FILESET SUBDIRS XPASS @@ -74,6 +74,17 @@ jobs: git config submodule.gnulib.url https://github.com/coreutils/gnulib.git git submodule update --init --recursive --depth 1 working-directory: gnu + - name: Restore files for faster configure and skipping make + uses: actions/cache@v5 + id: cache-config-gnu + with: + path: | + gnu/config.cache + gnu/src/getlimits + key: ${{ runner.os }}-gnu-config-${{ env.REPO_GNU_REF }}-${{ hashFiles('gnu/configure') }} + restore-keys: | + ${{ runner.os }}-gnu-config-${{ env.REPO_GNU_REF }}- + ${{ runner.os }}-gnu-config- #### Build environment setup - name: Install dependencies @@ -115,6 +126,15 @@ jobs: ## Build binaries cd 'uutils' env PROFILE=release-small bash util/build-gnu.sh + + - name: Save files for faster configure and skipping make + uses: actions/cache/save@v5 + if: always() && steps.cache-config-gnu.outputs.cache-hit != 'true' + with: + path: | + gnu/config.cache + gnu/src/getlimits + key: ${{ runner.os }}-gnu-config-${{ env.REPO_GNU_REF }}-${{ hashFiles('gnu/configure') }} ### Run tests as user - name: Run GNU tests diff --git a/util/build-gnu.sh b/util/build-gnu.sh index 626400d6a57..527a901827e 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -126,7 +126,7 @@ done if test -f gnu-built; then echo "GNU build already found. Skip" - echo "'rm -f $(pwd)/gnu-built' to force the build" + echo "'rm -f $(pwd)/{gnu-built,src/getlimits}' to force the build" echo "Note: the customization of the tests will still happen" else # Disable useless checks @@ -134,14 +134,16 @@ else "${SED}" -i '/^wget.*/d' bootstrap.conf # wget is used to DL po. Remove the dep. ./bootstrap --skip-po # Use CFLAGS for best build time since we discard GNU coreutils - CFLAGS="${CFLAGS} -pipe -O0 -s" ./configure --quiet --disable-gcc-warnings --disable-nls --disable-dependency-tracking --disable-bold-man-page-references \ + CFLAGS="${CFLAGS} -pipe -O0 -s" ./configure -C --quiet --disable-gcc-warnings --disable-nls --disable-dependency-tracking --disable-bold-man-page-references \ --enable-single-binary=symlinks \ "$([ "${SELINUX_ENABLED}" = 1 ] && echo --with-selinux || echo --without-selinux)" #Add timeout to to protect against hangs "${SED}" -i 's|^"\$@|'"${SYSTEM_TIMEOUT}"' 600 "\$@|' build-aux/test-driver # Use a better diff "${SED}" -i 's|diff -c|diff -u|g' tests/Coreutils.pm - "${MAKE}" -j "$("${NPROC}")" + # Skip make if possible + test -f src/getlimits || "${MAKE}" -j "$("${NPROC}")" + cp -f src/getlimits "${UU_BUILD_DIR}" # Handle generated factor tests t_first=00 @@ -223,8 +225,6 @@ sed -i -e "s|---dis ||g" tests/tail/overlay-headers.sh # Do not FAIL, just do a regular ERROR "${SED}" -i -e "s|framework_failure_ 'no inotify_add_watch';|fail=1;|" tests/tail/inotify-rotate-resources.sh -test -f "${UU_BUILD_DIR}/getlimits" || cp src/getlimits "${UU_BUILD_DIR}" - # pr produces very long log and this command isn't super interesting # SKIP for now "${SED}" -i -e "s|my \$prog = 'pr';$|my \$prog = 'pr';CuSkip::skip \"\$prog: SKIP for producing too long logs\";|" tests/pr/pr-tests.pl