Skip to content

Revert "Disable nbase tests" #215

Revert "Disable nbase tests"

Revert "Disable nbase tests" #215

Workflow file for this run

# Github Actions configuration
name: CI
permissions: {}
on:
# Trigger the workflow on push or pull requests, but only for the
# master and ci branches
push:
branches:
- master
- ci
pull_request:
branches:
- master
jobs:
build-22_04:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: 'Install deps'
run: >
sudo apt-get update -y &&
sudo apt-get install -y --no-install-suggests --no-install-recommends
arj
binutils
bsdextrautils
cabextract
calibre
cpio
dar
exif
exiftool
ffmpeg
file
flac
freetype2-demos
genisoimage
gettext
gifsicle
gimp
openjdk-18-jdk-headless
jq
lhasa
liballegro4-dev
libavifile-0.7-bin
libid3-tools
libjpeg-turbo-progs
libtiff-tools
lzop
man-db
mkvtoolnix
mtd-utils
netpbm
p7zip-full
pngtools
poppler-utils
python3-dateutil
python3-icu
python3-minimal
python3-pefile
python3-pip
python3-vobject
quicktime-utils
rar
rpm
squashfs-tools
unzip
vorbis-tools
wireshark-common
xmlstarlet
zpaq
make curl ca-certificates groff-base man2html-base bash busybox ksh toybox mmv yash zsh
- name: 'Install extras'
# A few packages need newer versions to work properly, so install them
# separately.
run: |
curl -LsSf --retry 6 --retry-connrefused --max-time 999 --remote-name-all \
http://azure.archive.ubuntu.com/ubuntu/pool/universe/l/lhasa/lhasa_0.4.0-1_amd64.deb \
http://azure.archive.ubuntu.com/ubuntu/pool/universe/l/lhasa/liblhasa0_0.4.0-1_amd64.deb \
http://azure.archive.ubuntu.com/ubuntu/pool/universe/p/pngtools/pngtools_0.5~git20220314.1ccca3a-2ubuntu1_amd64.deb \
http://azure.archive.ubuntu.com/ubuntu/pool/universe/n/netpbm-free/netpbm_11.01.00-2build1_amd64.deb \
http://azure.archive.ubuntu.com/ubuntu/pool/universe/n/netpbm-free/libnetpbm11_11.01.00-2build1_amd64.deb \
http://azure.archive.ubuntu.com/ubuntu/pool/universe/r/rust-coreutils/rust-coreutils_0.0.20-1_amd64.deb \
http://azure.archive.ubuntu.com/ubuntu/pool/universe/z/zoo/zoo_2.10-28_amd64.deb
sha256sum -c <<EOF
21f4edf6f7073b3f110d11c0a6a0d2fb399a21a4e807f524037027dce3c37798 lhasa_0.4.0-1_amd64.deb
0231c4875273b229aa8217064e64a280643b004a401fcb86f341e68a16bc495b liblhasa0_0.4.0-1_amd64.deb
d690a886c1ff250ebca438d7fa64f0a6f9f56a1543c312b503ed3209a56efda3 libnetpbm11_11.01.00-2build1_amd64.deb
ee102926ef4289c0830092447d650a58a48a0d136cab268af52b55d81d6485ce netpbm_11.01.00-2build1_amd64.deb
1c7490f01a64af135d6341b8e5a9ab2fc94dcfe99131882cef1e623739bfadc6 pngtools_0.5~git20220314.1ccca3a-2ubuntu1_amd64.deb
164db0e7af90ce9cf4174af674c38c52a3ce4b997894057580002ccff4f6f068 rust-coreutils_0.0.20-1_amd64.deb
953f4f94095ef3813dfd30c8977475c834363aaabce15ab85ac5195e52fd816a zoo_2.10-28_amd64.deb
EOF
sudo dpkg -i lhasa*.deb liblhasa*.deb pngtools*.deb netpbm*.deb libnetpbm*.deb rust-coreutils*.deb zoo*.deb || true Ignore missing dependency errors--they are not needed for our tests
# unrar isn't installed in /usr/bin for some reason
sudo install -m0755 -D /usr/lib/unrar -t /usr/local/bin
python3 -m pip install https://github.com/itkach/slob/archive/master.zip
- name: 'Run tests'
run: make check -k
- name: 'Run tests with ash'
run: make check -k SHELL='busybox ash'
- name: 'Run tests with bash'
run: make check -k SHELL=bash
- name: 'Run tests with dash'
run: make check -k SHELL=dash
- name: 'Run tests with ksh'
run: make check -k SHELL=ksh
- name: 'Run tests with yash'
run: make check -k SHELL=yash
- name: 'Run tests with zsh'
run: make check -k SHELL=zsh
- name: 'Prepare for Busybox'
run: |
mkdir -p "$PWD/bb"
busybox --install -s "$PWD/bb"
# These Busybox applets don't have the required features, so the native
# applications are needed instead.
rm -f "$PWD"/bb/{lzop,rpm,tar,unzip}
# Time zone output is different when using the fallback date routine
# that's used when uutils-coreutils, Busybox and Toybox 'date' is in
# use. All the lines are equivalent; only the time zone representation
# differs.
sed -i \
-e 's/2023-01-06 02:15:02 +0000/2023-01-05 21:15:02 -0500/' \
-e 's/2021-10-13 08:02:00 +0000/2021-10-13 01:02:00 -0700/' \
-e 's/2021-10-18 16:55:54 +0000/2021-10-18 16:55:54/' \
test-automtime-expected
- name: 'Run tests using Busybox'
run: PATH="$PWD/bb:$PATH" make check -k SHELL="$PWD/bb/sh"
- name: 'Prepare for uutils-coreutils'
run: |
# Time zone output is different when using the fallback date routine
# that's used when uutils-coreutils and Toybox 'date' is in use.
# Busybox date works in a few cases (so the fallback isn't needed)
# which is why these didn't need to be changed for the Busybox tests
# above.
sed -i \
-e 's/2021-10-13 08:34:00 +0000/2021-10-13 08:34:00/' \
-e 's/2021-10-14 20:36:00 +0000/2021-10-14 20:36:00/' \
test-automtime-expected
- name: 'Run tests using uutils-coreutils'
run: PATH="/usr/lib/cargo/bin/coreutils:$PATH" make check -k
- name: 'Prepare for Toybox'
run: |
mkdir -p "$PWD/tb"
for i in $(/usr/bin/toybox); do ln -s /usr/bin/toybox "$PWD/tb/$i"; done
- name: 'Run tests using Toybox'
run: PATH="$PWD/tb:$PATH" make check -k
- name: 'Prepare for dash filename tests'
run: |
# These tests consist of renaming all the test files to start with
# a dash so they look like command-line options in order to test that
# file names are properly escaped when passed in to programs.
# This is fairly brittle as it requires abusing the test files and
# requires duplicating information from within the makefile.
mmv 'testfiles/*type*' 'testfiles/-h-#1type#2'
sed -i -Ee 's,testfiles/((ext)?type),-h-\1,' test-*-expected
sed -i -e 's, type, -h-type,' test-fv-expected
- name: 'Run tests with dash filenames'
run: |
cd testfiles
PATH="$PWD/../tb:$PATH" ../autodescribe * >../test-autodescribe.log
for f in *exttype*; do FTYPE=${f/*exttype?./}; PATH="$PWD/../tb:$PATH" ../autodescribe -t "$FTYPE" "$f" >>../test-autodescribe.log; done
PATH="$PWD/../tb:$PATH" TZ=UTC ../automtime * >../test-automtime.log
PATH="$PWD/../tb:$PATH" ../fv *.{bz2,jffs2,rz,shar,uue} >../test-fv.log
PATH="$PWD/../tb:$PATH" ../fvi *.{3mf,7z,amf,deb,egg,class,gmo,po,stl,tc,wacz,warc.gz,whl} >../test-fvi.log
cd ..
diff test-autodescribe-expected test-autodescribe.log
diff test-automtime-expected test-automtime.log
diff test-fv-expected test-fv.log
diff test-fvi-expected test-fvi.log
- name: 'Build documentation'
run: make man
- name: 'Test installation'
run: make install prefix="$PWD/install"
- name: 'Test dist'
run: make dist
- name: 'Test distclean'
run: make distclean
# Tumbleweed is a rolling distribution, so changes in setting up the
# dependencies are expected to occur somewhat frequently.
build-opensuse:
runs-on: ubuntu-latest
container: opensuse/tumbleweed
steps:
- uses: actions/checkout@v4
- name: 'Install deps'
# The last line in the package list is for those needed by the build &
# test environment and not to handle a particular file type.
run: >
zypper --non-interactive refresh &&
zypper --non-interactive in --no-recommends -y
7zip
allegro44-tools
arj
binutils
cabextract
calibre
cpio
dar
exif
exiftool
ffmpeg-6
file
flac
ftdump
gawk
gettext-tools
gifsicle
gimp
id3lib-examples
java-21-openjdk-devel
jq
lhasa
libjpeg-turbo
lzop
man
mkisofs
mkvtoolnix
mtd-utils
netpbm
python311-pefile
python311-pip
python311-PyICU
python311-vobject
squashfs
tiff
unrar
unzip
vorbis-tools
wireshark
xmlstarlet
zoo
zpaq
zstd
make groff busybox
- name: 'Install contrib'
# nbase is only available in a contrib repo on OBS (as of 2023)
# nbase-tail and nbase-ls are completely broken in 9.1.0.2-8.39; don't
# install them
run: |
zypper --non-interactive addrepo https://download.opensuse.org/repositories/home:cheusov/openSUSE_Tumbleweed/home:cheusov.repo
zypper --non-interactive --gpg-auto-import-keys refresh
zypper --non-interactive --xmlout search --case-sensitive nbase- | xmlstarlet sel -t -v "/stream/search-result/solvable-list/solvable[not(contains(@name,'debuginfo') or contains(@name,'-tail') or contains(@name,'-ls'))]/@name" -nl | xargs zypper --non-interactive in --no-recommends -y
- name: 'Install extras'
# A few file types need packages unavailable in OpenSuSE, so install some
# binaries from elsewhere.
run: |
curl -LsSf --retry 6 --retry-connrefused --max-time 999 --remote-name-all \
https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/lib64png12_0-1.2.59-3.mga9.x86_64.rpm \
https://mirrors.kernel.org/mageia/distrib/9/x86_64/media/core/release/pngtools-0.4-9.mga9.x86_64.rpm
sha256sum -c <<EOF
5930a4f9864258b0b5fc18059d8aead64ae693991df2eb3751e1d9f3836ca79e lib64png12_0-1.2.59-3.mga9.x86_64.rpm
379f44b1c95d25358eb014c03835a4b4991c6c364a509c63780e587e70d5744b pngtools-0.4-9.mga9.x86_64.rpm
EOF
rpm -ivh lib64png12_0-1.2.59-3.mga9.x86_64.rpm pngtools-0.4-9.mga9.x86_64.rpm
python3 -m pip install --break-system-packages https://github.com/itkach/slob/archive/master.zip
- name: 'Patch tests'
run: |
# 7zip starting 22.01 displays seconds to 7 decimal places
sed -i \
-e 's/2021-10-14 20:48:03/2021-10-14 20:48:03.0000000/' \
test-automtime-expected
- name: 'Run tests'
run: make check -k
- name: 'Run tests with hush'
run: make check -k SHELL='busybox hush'
- name: 'Run tests using nbase'
run: PATH="/usr/libexec/nbase/bin:$PATH" make check -k
- name: 'Test installation'
run: make install prefix="$PWD/install"
- name: 'Test dist'
run: make dist
- name: 'Test distclean'
run: make distclean