Skip to content

Commit d1a0a72

Browse files
authored
Update test-apps.yml
1 parent 37f860a commit d1a0a72

File tree

1 file changed

+56
-59
lines changed

1 file changed

+56
-59
lines changed

.github/workflows/test-apps.yml

Lines changed: 56 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
branches: main
99
paths:
1010
- 'programs/x86_64/**'
11-
#- .github/workflows/test-apps.yml
11+
- .github/workflows/test-apps.yml
1212

1313
workflow_dispatch:
1414
inputs:
@@ -253,81 +253,78 @@ jobs:
253253
# Prevent the script from calling the "exit 1" command
254254
sed -i 's/|| exit 1//g' "programs/x86_64/${{ matrix.file }}"
255255
256-
# Blacklist some applications
257-
if [[ "$pure_arg" =~ (bat-extras|microsoft-edge*) ]]; then
258-
259-
echo "This app is blacklisted due to known errors related to GitHub Actions" | tee -a results/log-"${{ matrix.file }}"
260-
261-
else
262-
263-
# Install the application (first attempt)
264-
echo y | am -i "programs/x86_64/${{ matrix.file }}" --debug 2>&1 || sudo systemctl restart tor.service || systemctl restart tor.service
256+
# Special patches
257+
if [ "$pure_arg" = bat-extras ]; then
258+
sed -i 's/if ! command/if command/g' "programs/x86_64/${{ matrix.file }}"
259+
fi
260+
261+
# Install the application (first attempt)
262+
echo y | am -i "programs/x86_64/${{ matrix.file }}" --debug 2>&1 || sudo systemctl restart tor.service || systemctl restart tor.service
263+
LASTDIR=$(ls -td /opt/* | head -1 | sed 's:.*/::')
264+
265+
# Check if the app needs interaction to be installed
266+
if [[ "$pure_arg" =~ (libreoffice|mpv|wine) ]]; then
267+
echo 1 | am -i "programs/x86_64/${{ matrix.file }}" --debug 2>&1 || sudo systemctl restart tor.service || systemctl restart tor.service
265268
LASTDIR=$(ls -td /opt/* | head -1 | sed 's:.*/::')
266-
267-
# Check if the app needs interaction to be installed
268-
if [[ "$pure_arg" =~ (libreoffice|mpv|wine) ]]; then
269-
echo 1 | am -i "programs/x86_64/${{ matrix.file }}" --debug 2>&1 || sudo systemctl restart tor.service || systemctl restart tor.service
270-
LASTDIR=$(ls -td /opt/* | head -1 | sed 's:.*/::')
271-
if ! test -f /opt/"$LASTDIR"/remove; then
272-
echo 1 | torsocks am -i "programs/x86_64/${{ matrix.file }}" --debug 2>&1
273-
fi
269+
if ! test -f /opt/"$LASTDIR"/remove; then
270+
echo 1 | torsocks am -i "programs/x86_64/${{ matrix.file }}" --debug 2>&1
274271
fi
272+
fi
275273
276-
# Force installation if first attempt is not success
274+
# Force installation if first attempt is not success
275+
if ! test -f /opt/"$LASTDIR"/remove; then
276+
am -i "programs/x86_64/${{ matrix.file }}" --debug 2>&1 || sudo systemctl restart tor.service || systemctl restart tor.service
277+
LASTDIR=$(ls -td /opt/* | head -1 | sed 's:.*/::')
277278
if ! test -f /opt/"$LASTDIR"/remove; then
278-
am -i "programs/x86_64/${{ matrix.file }}" --debug 2>&1 || sudo systemctl restart tor.service || systemctl restart tor.service
279+
torsocks am -i "programs/x86_64/${{ matrix.file }}" --debug 2>&1
279280
LASTDIR=$(ls -td /opt/* | head -1 | sed 's:.*/::')
280-
if ! test -f /opt/"$LASTDIR"/remove; then
281-
torsocks am -i "programs/x86_64/${{ matrix.file }}" --debug 2>&1
282-
LASTDIR=$(ls -td /opt/* | head -1 | sed 's:.*/::')
283-
fi
284281
fi
282+
fi
285283
286-
# If the last modified directory is /opt/am, the installation has failed
287-
if [ "$LASTDIR" = am ]; then
288-
echo "### 💀 ${{ matrix.file }}" >> $GITHUB_STEP_SUMMARY
289-
echo "${{ matrix.file }}" >> results/log-${{ matrix.file }}
290-
exit 1
284+
# If the last modified directory is /opt/am, the installation has failed
285+
if [ "$LASTDIR" = am ]; then
286+
echo "### 💀 ${{ matrix.file }}" >> $GITHUB_STEP_SUMMARY
287+
echo "${{ matrix.file }}" >> results/log-${{ matrix.file }}
288+
exit 1
291289
292-
# If the last modified directory contains a file named "remove", check the installed files
293-
elif test -f /opt/"$LASTDIR"/remove; then
290+
# If the last modified directory contains a file named "remove", check the installed files
291+
elif test -f /opt/"$LASTDIR"/remove; then
294292
295-
printf "\n-------------------------------------------------------------\n\n"
293+
printf "\n-------------------------------------------------------------\n\n"
296294
297-
# Check structure of directories in /opt
298-
echo " Structure of the directory in /opt"
299-
echo ""
300-
ls /opt/"$LASTDIR" | tee -a results/log-"${{ matrix.file }}"
295+
# Check structure of directories in /opt
296+
echo " Structure of the directory in /opt"
297+
echo ""
298+
ls /opt/"$LASTDIR" | tee -a results/log-"${{ matrix.file }}"
301299
302-
printf "\n-------------------------------------------------------------\n\n"
300+
printf "\n-------------------------------------------------------------\n\n"
303301
304-
# Check the command in /usr/local/bin
305-
echo " Command in \$PATH"
306-
echo ""
307-
command -v "$pure_arg" | tee -a results/log-"${{ matrix.file }}" || command -v "$LASTDIR" | tee -a results/log-"${{ matrix.file }}" || ls /usr/local/bin | tee -a results/log-"${{ matrix.file }}"
302+
# Check the command in /usr/local/bin
303+
echo " Command in \$PATH"
304+
echo ""
305+
command -v "$pure_arg" | tee -a results/log-"${{ matrix.file }}" || command -v "$LASTDIR" | tee -a results/log-"${{ matrix.file }}" || ls /usr/local/bin | tee -a results/log-"${{ matrix.file }}"
308306
309-
printf "\n-------------------------------------------------------------\n\n"
307+
printf "\n-------------------------------------------------------------\n\n"
310308
311-
# Check launchers in /usr/local/share/applications
312-
echo " Launchers in /usr/local/share/applications" | tee -a results/log-"${{ matrix.file }}"
313-
echo ""
314-
if test -f /usr/local/share/applications/*AM.desktop 2>/dev/null; then
315-
ls /usr/local/share/applications | grep "AM.desktop$" | tee -a results/log-"${{ matrix.file }}"
316-
else
317-
ls /usr/local/share/applications | tee -a results/log-"${{ matrix.file }}"
318-
fi
309+
# Check launchers in /usr/local/share/applications
310+
echo " Launchers in /usr/local/share/applications" | tee -a results/log-"${{ matrix.file }}"
311+
echo ""
312+
if test -f /usr/local/share/applications/*AM.desktop 2>/dev/null; then
313+
ls /usr/local/share/applications | grep "AM.desktop$" | tee -a results/log-"${{ matrix.file }}"
314+
else
315+
ls /usr/local/share/applications | tee -a results/log-"${{ matrix.file }}"
316+
fi
319317
320-
printf "\n-------------------------------------------------------------\n\n"
318+
printf "\n-------------------------------------------------------------\n\n"
321319
322-
# Remove the application
323-
am -R "$LASTDIR" && echo "${{ matrix.file }}" >> results/ok-${{ matrix.file }} || echo "${{ matrix.file }}" >> results/log-${{ matrix.file }}
320+
# Remove the application
321+
am -R "$LASTDIR" && echo "${{ matrix.file }}" >> results/ok-${{ matrix.file }} || echo "${{ matrix.file }}" >> results/log-${{ matrix.file }}
324322
325-
# Any other result is a failure
326-
else
327-
echo "### 💀 ${{ matrix.file }}" >> $GITHUB_STEP_SUMMARY
328-
echo "${{ matrix.file }}" >> results/log-${{ matrix.file }}
329-
exit 1
330-
fi
323+
# Any other result is a failure
324+
else
325+
echo "### 💀 ${{ matrix.file }}" >> $GITHUB_STEP_SUMMARY
326+
echo "${{ matrix.file }}" >> results/log-${{ matrix.file }}
327+
exit 1
331328
fi
332329
333330
- name: "Rename Failed Results ☝️"

0 commit comments

Comments
 (0)