Skip to content

Commit 81bc27c

Browse files
committed
ci: provide dummy ALSA device for software tests
1 parent 6f2c261 commit 81bc27c

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

.github/workflows/dietpi-software.bash

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ emulation=0
9494
##########################################
9595
# Create service and port lists
9696
##########################################
97-
aINSTALL=() aSERVICES=() aTCP=() aUDP=() aCOMMANDS=() aDELAY=() CAPABILITIES='' SYSCALLS='' aOPTIONS=()
97+
aINSTALL=() aSERVICES=() aTCP=() aUDP=() aCOMMANDS=() aDELAY=() CAPABILITIES='' SYSCALLS='' aOPTIONS=() AUDIO=0
9898
Process_Software()
9999
{
100100
local i
@@ -108,7 +108,7 @@ Process_Software()
108108
2) aSERVICES[i]='fahclient' aTCP[i]='7396';;
109109
3) aCOMMANDS[i]='mc -V';;
110110
4) aCOMMANDS[i]='fish -v';;
111-
5) aCOMMANDS[i]='aplay -l';;
111+
5) aCOMMANDS[i]='aplay -l' AUDIO=1;;
112112
6) aCOMMANDS[i]='X -version';;
113113
7) aCOMMANDS[i]='ffmpeg -version';;
114114
8) aCOMMANDS[i]='javac -version';;
@@ -117,7 +117,7 @@ Process_Software()
117117
11) aCOMMANDS[i]='gzdoom -norun | grep '\''^GZDoom version '\';;
118118
12) aSERVICES[i]='rustdesksignal rustdeskrelay' aTCP[i]='21115 21116 21117 21118 21119' aUDP[i]='21116';;
119119
#16) aSERVICES[i]='microblog-pub' aTCP[i]='8007';; Service enters a CPU-intense internal error loop until it has been configured interactively via "microblog-pub configure", hence it is not enabled and started anymore after install but instead as part of "microblog-pub configure"
120-
17) aCOMMANDS[i]='git --version';; # from Bookworm on, the shorthand "-v" is supported
120+
17) aCOMMANDS[i]='git -v';;
121121
#22) QuiteRSS: has no CLI
122122
23) aCOMMANDS[i]='lxsession -h';;
123123
24) aCOMMANDS[i]='mate-session -h';;
@@ -132,7 +132,7 @@ Process_Software()
132132
33) (( $emulation )) || aSERVICES[i]='airsonic' aTCP[i]='8080' aDELAY[i]=60;; # Fails in QEMU-emulated containers, probably due to missing device access
133133
34) aCOMMANDS[i]='COMPOSER_ALLOW_SUPERUSER=1 composer -n -V';;
134134
35) aSERVICES[i]='lyrionmusicserver' aTCP[i]='9000';;
135-
36) aCOMMANDS[i]='squeezelite -t';; # Service listens on random high UDP port and exits if no audio device has been found, which does not exist on GitHub Actions runners, respectively within the containers
135+
36) aSERVICES[i]='squeezelite';; # Service listens on random high UDP port
136136
37) aSERVICES[i]='shairport-sync' aTCP[i]='5000';; # AirPlay 2 would be TCP port 7000
137137
38) aCOMMANDS[i]='/opt/FreshRSS/cli/user-info.php';;
138138
39) aSERVICES[i]='minidlna' aTCP[i]='8200';;
@@ -233,7 +233,7 @@ Process_Software()
233233
132) aSERVICES[i]='aria2' aTCP[i]='6800';; # aTCP[i]+=' 6881-6999';; # Listens on random port
234234
133) aSERVICES[i]='yacy' aTCP[i]='8090'; (( $emulation )) && aDELAY[i]=120;;
235235
134) aCOMMANDS[i]='docker compose version';;
236-
135) aSERVICES[i]='icecast2' aTCP[i]='8000' aCOMMANDS[i]='darkice -h | grep '\''^DarkIce'\';; # darkice service cannot start in container as is requires audio recording device access
236+
135) aSERVICES[i]='icecast2 darkice' aTCP[i]='8000';;
237237
136) aSERVICES[i]='motioneye' aTCP[i]='8765';;
238238
137) aCOMMANDS[i]='/opt/mjpg-streamer/mjpg_streamer -v';; # aSERVICES[i]='mjpg-streamer' aTCP[i]='8082' Service does not start without an actual video device
239239
138) aSERVICES[i]='virtualhere' aTCP[i]='7575';;
@@ -348,6 +348,7 @@ do
348348
79) Process_Software 85 88 89;;
349349
81) Process_Software 84 87 89;;
350350
82) Process_Software 84 88 89;;
351+
23|24|25|26|173|31|33|36|37|40|118|121|124|128|135|154|163|167|191|192|199|204|108|10|51|112|156|11|189|113|67) Process_Software 5;;
351352
*) :;;
352353
esac
353354
Process_Software "$i"
@@ -358,10 +359,20 @@ done
358359
##########################################
359360
apackages=('xz-utils' 'parted' 'fdisk' 'systemd-container')
360361

362+
# Dummy sound device
363+
if (( $AUDIO )) && ! lsmod | grep -q '^snd' && uname -r | grep -q '-azure$'
364+
then
365+
apackages+=("linux-modules-extra-$(uname -r)")
366+
else
367+
AUDIO=0
368+
fi
369+
361370
(( $emulation )) && apackages+=('qemu-user-static')
362371

363372
G_AG_CHECK_INSTALL_PREREQ "${apackages[@]}"
364373

374+
(( $AUDIO )) && G_EXEC modprobe snd_dummy
375+
365376
# Register QEMU binfmt configs
366377
(( $emulation )) && G_EXEC systemctl restart systemd-binfmt
367378

0 commit comments

Comments
 (0)