ci: Replace while loop with tail of multiple files

Gives the exact same output:

```
docker run --rm -ti debian:11 bash -c '
  mkdir -p build/subdir1/ build/subdir2
  echo "subdir1 error" >build/subdir1/fail.log
  echo "subdir2 error" >build/subdir2/fail.log
  find build -type f -name "*.log" -exec tail -n +1 "{}" +
'
==> build/subdir1/fail.log <==
subdir1 error

==> build/subdir2/fail.log <==
subdir2 error
```

Signed-off-by: Manuel Mendez <github@i.m.mmlb.dev>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
This commit is contained in:
Manuel Mendez 2024-03-27 15:29:09 -04:00 committed by Thierry Laurion
parent 713eadc129
commit de3f4ec2a3
No known key found for this signature in database
GPG Key ID: 9A53E1BB3FF00461

View File

@ -89,13 +89,7 @@ commands:
name: Output build failing logs name: Output build failing logs
command: | command: |
if [[ -f ./tmpDir/failed_build ]]; then if [[ -f ./tmpDir/failed_build ]]; then
find "./build/<<parameters.arch>>/" -name "*.log" -type f -mmin -1 | find "./build/<<parameters.arch>>/" -name "*.log" -type f -mmin -1 -exec tail -n +1 '{}' +
while read log; do
echo ""
echo '==>' "$log" '<=='
echo ""
cat "$log"
done
exit 1 exit 1
else else
echo "Step hasn't failed. Continuing with next step..." echo "Step hasn't failed. Continuing with next step..."
@ -571,7 +565,6 @@ workflows:
subcommand: "" subcommand: ""
requires: requires:
- nitropad-nv41 - nitropad-nv41
# - build: # - build:
# name: UNMAINTAINED_kgpe-d16_workstation-usb_keyboard # name: UNMAINTAINED_kgpe-d16_workstation-usb_keyboard
# target: UNMAINTAINED_kgpe-d16_workstation-usb_keyboard # target: UNMAINTAINED_kgpe-d16_workstation-usb_keyboard