ci: Add antivirus check with clamav scan.

setup.py
Pierre-Antoine Rouby 2024-02-02 11:23:39 +01:00
parent 21e97d4e30
commit d541becb1a
2 changed files with 36 additions and 0 deletions

View File

@ -20,6 +20,7 @@ stages:
- test
- build
- package
- antivirus
- release
#############
@ -403,6 +404,25 @@ windows-package-exe:
- copy ..\packages\pamhyr.nsi pamhyr.nsi
- .\make-windows-exe.bat
pkg-check-clamav:
stage: antivirus
tags:
- release
- linux
needs:
- job: linux-package-tar
artifacts: true
- job: windows-package-zip
artifacts: true
- job: windows-package-exe
artifacts: true
rules:
- if: $CI_COMMIT_BRANCH == 'ci-test' || $CI_COMMIT_TAG
script:
- cd packages
- ./clamav-scan.sh
allow_failure: true
###########
# RELEASE #
###########

16
packages/clamav-scan.sh Executable file
View File

@ -0,0 +1,16 @@
#! /bin/bash
set +x
OPTS="-r -a"
FILES="../windows/pamhyr-windows.exe ../windows/pamhyr-windows.zip ../linux/pamhyr-gnulinux.tar.xz"
clamscan $OPTS $FILES | tee clamav.log
RES=$(cat clamav.log | grep "Infected files: 0")
if [ -z "$RES" ]; then
echo "Infected files"
exit -1
else
echo "OK"
exit 0
fi