-
Notifications
You must be signed in to change notification settings - Fork 0
270 lines (265 loc) · 9.71 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# 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 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