From 080abd5e627703d4371ae619723a308a4064c125 Mon Sep 17 00:00:00 2001 From: Dwi Siswanto Date: Wed, 15 Jan 2025 16:24:43 +0700 Subject: [PATCH] ci(perf-test): add flamegraph action Signed-off-by: Dwi Siswanto --- .github/workflows/perf-test.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/perf-test.yaml b/.github/workflows/perf-test.yaml index b45a85ea38..e30d084d5f 100644 --- a/.github/workflows/perf-test.yaml +++ b/.github/workflows/perf-test.yaml @@ -15,12 +15,21 @@ jobs: if: github.repository == 'projectdiscovery/nuclei' env: LIST_FILE: "/tmp/targets-${{ matrix.count }}.txt" + PROFILE_MEM: "nuclei-perf-test-${{ matrix.count }}" steps: - uses: actions/checkout@v4 - uses: projectdiscovery/actions/setup/go@v1 - run: make verify - name: Generate list run: for i in {1..${{ matrix.count }}}; do echo "https://scanme.sh/?_=${i}" >> "${LIST_FILE}"; done - - run: go run ${{ matrix.flags }} . -l "${LIST_FILE}" + - run: go run ${{ matrix.flags }} . -l "${LIST_FILE}" -profile-mem="${PROFILE_MEM}" working-directory: cmd/nuclei/ - + - uses: projectdiscovery/actions/flamegraph@v1 + id: flamegraph + with: + profile: "${{ env.PROFILE_MEM }}.prof" + continue-on-error: true + - if: ${{ steps.flamegraph.outputs.message == '' }} + run: echo "::notice::${FLAMEGRAPH_URL}" + env: + FLAMEGRAPH_URL: ${{ steps.flamegraph.outputs.url }} \ No newline at end of file