1
1
libssh2/ci/ossfuzz.sh
Gabriel Smith ee199144fe
ci: Swap from Travis to Github Actions (#581)
Files: ci files

Notes:
Move Linux CI using Github Actions

Credit:
Gabriel Smith, Marc Hörsken
2021-04-30 16:10:52 -07:00

30 строки
859 B
Bash
Исполняемый файл

#!/bin/bash
set -ex
PROJECT_NAME=libssh2
# Clone the oss-fuzz repository
git clone https://github.com/google/oss-fuzz.git /tmp/ossfuzz
if [[ ! -d /tmp/ossfuzz/projects/${PROJECT_NAME} ]]
then
echo "Could not find the ${PROJECT_NAME} project in ossfuzz"
# Exit with a success code while the libssh2 project is not expected to exist
# on oss-fuzz.
exit 0
fi
# Modify the oss-fuzz Dockerfile so that we're checking out the current branch in the CI system.
sed -i \
-e "s@--depth 1@--no-checkout@" \
-e "s@/src/libssh2@/src/libssh2 ; git -C /src/libssh2 fetch origin $GIT_REF:ci; git -C /src/libssh2 checkout ci@" \
/tmp/ossfuzz/projects/${PROJECT_NAME}/Dockerfile
# Try and build the fuzzers
pushd /tmp/ossfuzz
python infra/helper.py build_image --pull ${PROJECT_NAME}
python infra/helper.py build_fuzzers ${PROJECT_NAME}
popd