From c874a6e17c925e3014cf961d0b99f9730584cab3 Mon Sep 17 00:00:00 2001 From: Kostiantyn Masliuk <1pkg@protonmail.com> Date: Wed, 21 Aug 2024 16:44:09 -0700 Subject: [PATCH] Only upload benchmarks result from main branch. --- .github/workflows/benchmarks.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 2a2ee96d1de..a99e605be5f 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -119,13 +119,20 @@ jobs: - name: Run benchmarks autotuned if: ${{ inputs.benchmarkAgents == '' }} - run: make run-benchmark-autotuned index-benchmark-results + run: make run-benchmark-autotuned - name: Run benchmarks self tuned if: ${{ inputs.benchmarkAgents != '' }} - run: make run-benchmark index-benchmark-results + run: make run-benchmark + + # Results are only indexed and uploaded if the run happens on the main branch. + + - name: Index benchmarks result + if: github.ref == 'refs/heads/main' + run: make index-benchmark-results - name: Download PNG + if: github.ref == 'refs/heads/main' run: >- ${{ github.workspace }}/.ci/scripts/download-png-from-kibana.sh ${{ secrets.KIBANA_BENCH_ENDPOINT }} @@ -134,6 +141,7 @@ jobs: $PNG_REPORT_FILE - name: Upload PNG + if: github.ref == 'refs/heads/main' uses: actions/upload-artifact@v4 with: name: kibana-png-report @@ -141,6 +149,7 @@ jobs: if-no-files-found: error - name: Upload PNG to AWS S3 + if: github.ref == 'refs/heads/main' id: s3-upload-png env: AWS_DEFAULT_REGION: us-east-1 @@ -150,6 +159,7 @@ jobs: echo "png_report_url=https://elastic-apm-server-benchmark-reports.s3.amazonaws.com/${DEST_NAME}" >> "$GITHUB_OUTPUT" - name: Upload benchmark result + if: github.ref == 'refs/heads/main' uses: actions/upload-artifact@v4 if: always() with: