2021-07-30 15:29:12 +05:30
|
|
|
#!/bin/bash
|
|
|
|
|
|
2025-05-18 20:09:41 +05:30
|
|
|
if [ "${RUNNER_OS}" == "Windows" ]; then
|
|
|
|
|
EXT=".exe"
|
|
|
|
|
elif [ "${RUNNER_OS}" == "macOS" ]; then
|
|
|
|
|
if [ "${CI}" == "true" ]; then
|
|
|
|
|
sudo sysctl -w kern.maxfiles{,perproc}=524288
|
|
|
|
|
sudo launchctl limit maxfiles 65536 524288
|
|
|
|
|
fi
|
2021-12-16 02:17:29 -06:00
|
|
|
|
2025-05-18 20:09:41 +05:30
|
|
|
ORIGINAL_ULIMIT="$(ulimit -n)"
|
|
|
|
|
ulimit -n 65536 || true
|
2021-12-16 02:17:29 -06:00
|
|
|
fi
|
|
|
|
|
|
2025-05-18 20:09:41 +05:30
|
|
|
mkdir -p .nuclei-config/nuclei/
|
|
|
|
|
touch .nuclei-config/nuclei/.nuclei-ignore
|
|
|
|
|
|
2021-12-14 18:13:53 +02:00
|
|
|
echo "::group::Building functional-test binary"
|
2025-05-18 20:09:41 +05:30
|
|
|
go build -o "functional-test${EXT}"
|
2021-12-14 18:13:53 +02:00
|
|
|
echo "::endgroup::"
|
2021-08-02 11:40:44 +05:30
|
|
|
|
2021-12-14 18:13:53 +02:00
|
|
|
echo "::group::Building Nuclei binary from current branch"
|
2025-05-18 20:09:41 +05:30
|
|
|
go build -o "nuclei-dev${EXT}" ../nuclei
|
|
|
|
|
echo "::endgroup::"
|
|
|
|
|
|
|
|
|
|
echo "::group::Building latest release of nuclei"
|
|
|
|
|
go build -o "nuclei${EXT}" -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei
|
2021-12-14 18:13:53 +02:00
|
|
|
echo "::endgroup::"
|
2021-08-02 11:40:44 +05:30
|
|
|
|
2022-03-03 19:10:03 +05:30
|
|
|
echo "::group::Installing nuclei templates"
|
2025-05-18 20:09:41 +05:30
|
|
|
eval "./nuclei-dev${EXT} -update-templates"
|
2022-03-03 19:10:03 +05:30
|
|
|
echo "::endgroup::"
|
|
|
|
|
|
2025-05-18 20:09:41 +05:30
|
|
|
echo "::group::Validating templates"
|
|
|
|
|
eval "./nuclei-dev${EXT} -validate"
|
2021-12-14 18:13:53 +02:00
|
|
|
echo "::endgroup::"
|
2021-08-02 11:40:44 +05:30
|
|
|
|
2025-05-18 20:09:41 +05:30
|
|
|
echo "Starting Nuclei functional test"
|
|
|
|
|
eval "./functional-test${EXT} -main ./nuclei${EXT} -dev ./nuclei-dev${EXT} -testcases testcases.txt"
|
|
|
|
|
|
|
|
|
|
if [ "${RUNNER_OS}" == "macOS" ]; then
|
|
|
|
|
ulimit -n "${ORIGINAL_ULIMIT}" || true
|
|
|
|
|
fi
|