CI: Remove corrupted downloads for build retry

We have implemented CI Build Retry for mitigating Download Failures. But right now it will reuse any Corrupted Downloads (instead of deleting them), which will cause CI Build Retry to fail repeatedly: https://github.com/apache/nuttx/actions/runs/24611381081/job/71966407518#step:10:627

```
Ignored files: system/argtable3/v3.2.0.7402e6e.tar.gz
gzip: stdin: not in gzip format
make[3]: *** [Makefile:76: argtable3] Error 2
```

This PR proposes to change `git clean -fd` to `git clean -xfdq`. This will remove any Corrupted Downloads, preventing their reuse for CI Build Retry:

```bash
## Simulate a corrupted download for argtable3
$ tools/configure.sh qemu-armv8a/netnsh
$ Downloading v3.2.0.7402e6e.tar.gz--argtable3
## Press Ctrl-C to stop the build

## `git clean -fd` won't remove the corrupted download
$ cd ../apps
$ git clean -fd
$ find . -name "v3.2.0.7402e6e.tar.gz"
./system/argtable3/v3.2.0.7402e6e.tar.gz

## `git clean -xfdq` removes the corrupted download
$ git clean -xfdq
$ find . -name "v3.2.0.7402e6e.tar.gz"
## Corrupted download is deleted correctly
```

`git clean -xfdq` is also found in the same testbuild script, so we are using it consistently:

12e8f92a28/tools/testbuild.sh (L286-L291)

Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
This commit is contained in:
Lup Yuen Lee 2026-04-19 08:16:10 +08:00
parent eb4df019af
commit 3e570aa219

View file

@ -599,15 +599,15 @@ function retrytest {
break
else
# Build Failed: Clean up any corrupted downloads, don't reuse
git -C $nuttx clean -fd
git -C $APPSDIR clean -fd
git -C $nuttx clean -xfdq
git -C $APPSDIR clean -xfdq
pushd $nuttx ; git status ; popd
pushd $APPSDIR ; git status ; popd
fi
# If this is Final Retry: Don't retry subsequent builds
if [ $i -eq $maxbuilds ]; then
maxbuilds=1
maxbuilds=1
break
fi