Add ability to not run %check commands
All checks were successful
Build docker image / build-and-publish (push) Successful in 3m0s

This commit is contained in:
Carlos Mogas da Silva 2024-12-04 13:15:16 +00:00
parent d6385ccfcf
commit 47234433a8
2 changed files with 10 additions and 1 deletions

View file

@ -12,6 +12,10 @@ inputs:
description: "Target arch to build the package"
required: true
default: "x86_64"
nocheck:
description: "Don't run %check commands"
required: false
default: false
outputs:
rpm:

View file

@ -3,6 +3,7 @@
SPEC=${INPUT_SPEC}
SYSTEM=${INPUT_SYSTEM}
ARCH=${INPUT_ARCH}
NOCHECK=${INPUT_NOCHECK}
SPEC_NAME=$(basename ${SPEC})
CONFIGURATION="${SYSTEM}-${ARCH}"
@ -28,7 +29,11 @@ echo "::endgroup::"
SRPM=$(grep Wrote result/build.log | cut -d" " -f 2)
echo "::group::Building RPM"
mock -r "${SYSTEM}-${ARCH}" --resultdir result ${SRPM}
OPTS=""
if [ ${NOCHECK,,} == "true"]; then
OPTS="${OPTS} --nocheck"
fi
mock -r "${SYSTEM}-${ARCH}" --resultdir result ${OPTS} ${SRPM}
if [ $? -ne 0 ]; then
echo "::error Failed to build RPM"
exit 1