coreutils/.github/workflows/GNU.yml

102 lines
4.3 KiB
YAML
Raw Normal View History

2021-01-21 07:19:08 +00:00
name: GNU
on: [push, pull_request]
jobs:
gnu:
name: Run GNU tests
runs-on: ubuntu-latest
steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code uutil
uses: actions/checkout@v2
with:
path: 'uutils'
- name: Chechout GNU coreutils
uses: actions/checkout@v2
with:
repository: 'coreutils/coreutils'
path: 'gnu'
- name: Chechout GNU corelib
uses: actions/checkout@v2
with:
repository: 'coreutils/gnulib'
path: 'gnulib'
fetch-depth: 0 # gnu gets upset if gnulib is a shallow checkout
- name: Install `rust` toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
profile: minimal # minimal component installation (ie, no documentation)
components: rustfmt
2021-01-21 22:56:02 +00:00
- name: Build binaries
2021-01-21 07:19:08 +00:00
shell: bash
run: |
2021-02-03 21:27:30 +00:00
sudo apt-get update
sudo apt-get install autoconf autopoint bison texinfo gperf gcc g++ gdb python-pyinotify expect python3-sphinx
2021-01-21 07:19:08 +00:00
pushd uutils
2021-02-03 21:27:30 +00:00
make PROFILE=release
2021-01-21 07:19:08 +00:00
BUILDDIR="$PWD/target/release/"
popd
GNULIB_SRCDIR="$PWD/gnulib"
pushd gnu/
./bootstrap --gnulib-srcdir="$GNULIB_SRCDIR"
./configure --quiet --disable-gcc-warnings
# Change the PATH in the Makefile to test the uutils coreutils instead of the GNU coreutils
2021-01-21 07:19:08 +00:00
sed -i "s/^[[:blank:]]*PATH=.*/ PATH='${BUILDDIR//\//\\/}\$(PATH_SEPARATOR)'\"\$\$PATH\" \\\/" Makefile
sed -i 's| tr | /usr/bin/tr |' tests/init.sh
make
2021-02-03 21:30:20 +00:00
# Generate the factor tests, so they can be fixed
for i in $(seq -w 1 36)
do
make tests/factor/t${i}.sh
done
grep -rl 'path_prepend_' tests/* | xargs sed -i 's|path_prepend_ ./src||'
2021-02-03 21:33:14 +00:00
sed -i -e 's|^seq |/usr/bin/seq |' tests/factor/t*sh
sed -i -e '/tests\/misc\/cat-self.sh/ D' Makefile # issue #1707
sed -i -e '/tests\/misc\/numfmt.pl/ D' Makefile # issue #1708
sed -i -e '/tests\/chown\/preserve-root.sh/ D' Makefile # issue #1709
sed -i -e '/tests\/cp\/file-perm-race.sh/ D' Makefile # issue #1710
sed -i -e '/tests\/cp\/special-f.sh/ D' Makefile # issue #1710
sed -i -e '/tests\/mv\/mv-special-1.sh/ D' Makefile # issue #1710
sed -i -e '/tests\/dd\/stats.sh/ D' Makefile # issue #1710
sed -i -e '/tests\/cp\/existing-perm-race.sh/ D' Makefile # hangs, cp doesn't implement --copy-contents
# Remove tests that rely on seq with large numbers. See issue #1703
sed -i -e '/tests\/misc\/seq.pl/ D' \
-e '/tests\/misc\/seq-precision.sh/D' \
Makefile
# Remove tests checking for --version & --help
# Not really interesting for us and logs are too big
sed -i -e '/tests\/misc\/invalid-opt.pl/ D' \
-e '/tests\/misc\/help-version.sh/ D' \
-e '/tests\/misc\/help-version-getopt.sh/ D' \
Makefile
2021-02-03 21:33:14 +00:00
sed -i -e '/tests\/tail-2\/pid.sh/ D' Makefile # hangs on github, tail doesn't support -f
2021-02-04 18:42:43 +00:00
sed -i -e'/incompat4/ D' -e"/options '-co' are incompatible/ d" tests/misc/sort.pl # Sort doesn't correctly check for incompatible options, waits for input
2021-02-03 21:33:14 +00:00
2021-01-21 22:56:02 +00:00
test -f "${BUILDDIR}/getlimits" || cp src/getlimits "${BUILDDIR}"
- name: Run GNU tests
shell: bash
run: |
BUILDDIR="${PWD}/uutils/target/release"
GNULIB_DIR="${PWD}/gnulib"
pushd gnu
unbuffer timeout -sKILL 3600 make -j "$(nproc)" check SUBDIRS=. RUN_EXPENSIVE_TESTS=yes RUN_VERY_EXPENSIVE_TESTS=yes VERBOSE=no || :
- name: Extract tests info
shell: bash
run: |
TOTAL=$( grep "# TOTAL:" gnu/tests/test-suite.log|cut -d' ' -f2-)
PASS=$( grep "# PASS:" gnu/tests/test-suite.log|cut -d' ' -f2-)
SKIP=$( grep "# SKIP:" gnu/tests/test-suite.log|cut -d' ' -f2-)
FAIL=$( grep "# FAIL:" gnu/tests/test-suite.log|cut -d' ' -f2-)
XPASS=$( grep "# XPASS:" gnu/tests/test-suite.log|cut -d' ' -f2-)
ERROR=$( grep "# ERROR:" gnu/tests/test-suite.log|cut -d' ' -f2-)
echo "::warning ::GNU testsuite = $TOTAL / $PASS / $FAIL / $ERROR"
2021-02-03 21:38:24 +00:00
- uses: actions/upload-artifact@v2
with:
name: test-report
path: gnu/tests/**/*.log