Handle < and > for HTML in autodescribe #259
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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-24_04: | |
runs-on: ubuntu-24.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 | |
ffmpeg | |
file | |
flac | |
freetype2-demos | |
genisoimage | |
gettext | |
gifsicle | |
gimp | |
openjdk-21-jdk-headless | |
jq | |
lhasa | |
liballegro4-dev | |
libavifile-0.7-bin | |
libid3-tools | |
libimage-exiftool-perl | |
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 | |
rust-coreutils | |
squashfs-tools | |
unrar | |
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' | |
# One package is no longer available in Ubuntu and must be installed manually | |
run: | | |
curl -LsSf --retry 6 --retry-connrefused --max-time 999 --remote-name-all \ | |
http://azure.archive.ubuntu.com/ubuntu/pool/universe/z/zoo/zoo_2.10-28_amd64.deb | |
sha256sum -c <<EOF | |
953f4f94095ef3813dfd30c8977475c834363aaabce15ab85ac5195e52fd816a zoo_2.10-28_amd64.deb | |
EOF | |
sudo dpkg -i zoo*.deb | |
python3 -m pip install --break-system-packages 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 | |
# Toybox file doesn't support decoding Microsoft compound documents | |
sed -i -e '/type[0-9]\.doc\>/d' test-autodescribe-expected test-automtime-expected | |
- 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-7 | |
file | |
flac | |
ftdump | |
gettext-tools | |
gifsicle | |
gimp | |
id3lib-examples | |
java-22-openjdk-devel | |
jq | |
lhasa | |
libjpeg-turbo | |
lzop | |
man | |
mawk | |
mkisofs | |
mkvtoolnix | |
mtd-utils | |
netpbm | |
python312-pefile | |
python312-pip | |
python312-PyICU | |
python312-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 2024) | |
# nbase-tail and nbase-ls are completely broken in 9.1.0.2-8.39 and 9.3.0.1-55.13; | |
# don't install them | |
run: | | |
zypper --non-interactive addrepo https://download.opensuse.org/repositories/home:cheusov/openSUSE_Tumbleweed/home:cheusov.repo | |
zypper --non-interactive addrepo https://download.opensuse.org/repositories/devel:languages:misc/openSUSE_Tumbleweed/devel:languages:misc.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 | |
zypper --non-interactive in --no-recommends -y gash | |
- 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 | |
# Make python 3.12 the default to test with the latest | |
rm /usr/bin/python3 | |
ln -s python3.12 /usr/bin/python3 | |
python3 -m pip install --break-system-packages https://github.com/itkach/slob/archive/master.zip | |
# Set mawk as the default for test diversity | |
ln -s mawk /usr/bin/awk | |
- name: 'Run tests' | |
run: make check -k | |
- name: 'Run tests with hush' | |
run: make check -k SHELL='busybox hush' | |
- name: 'Run tests with gash' | |
run: make check -k SHELL=gash | |
- 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 |