From 5993cb94e42ba87b61e60f991774d3016a5cb41e Mon Sep 17 00:00:00 2001 From: pranavm Date: Wed, 18 Dec 2024 11:03:00 -0800 Subject: [PATCH] Disables pushing benchmark results for forks It is not easily possible to share artifacts between workflows. Instead, we will simply not upload benchmark results from a PR from a fork. The only edge case here would be when such a PR introduces a new performance test. In that case, the first benchmarks for that test would only be uploaded from the first non-fork PR. --- .github/workflows/tripy-l0.yml | 8 +----- .github/workflows/tripy-update-benchmark.yml | 27 -------------------- 2 files changed, 1 insertion(+), 34 deletions(-) delete mode 100644 .github/workflows/tripy-update-benchmark.yml diff --git a/.github/workflows/tripy-l0.yml b/.github/workflows/tripy-l0.yml index a29d34b9c..fed639fc5 100644 --- a/.github/workflows/tripy-l0.yml +++ b/.github/workflows/tripy-l0.yml @@ -85,15 +85,9 @@ jobs: tool: 'pytest' output-file-path: ${{ github.workspace }}/tripy/benchmark.json github-token: ${{ secrets.GITHUB_TOKEN }} - auto-push: false + auto-push: ${{ !github.event.pull_request.head.repo.fork }} # Show alert with commit comment on detecting possible performance regression alert-threshold: '105%' comment-on-alert: true fail-on-alert: true gh-pages-branch: benchmarks - - - name: Upload benchmark result - uses: actions/upload-artifact@v4 - with: - name: benchmark-results - path: ${{ github.workspace }}/tripy/benchmark.json diff --git a/.github/workflows/tripy-update-benchmark.yml b/.github/workflows/tripy-update-benchmark.yml deleted file mode 100644 index 58a919167..000000000 --- a/.github/workflows/tripy-update-benchmark.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Post-merge benchmark update - -on: - push: - branches: [ "main" ] - -permissions: - contents: write - -jobs: - upload-benchmarks: - runs-on: ubuntu-latest - steps: - - name: Retrieve benchmark results - uses: actions/download-artifact@v4 - with: - name: benchmark-results - path: ${{ github.workspace }}/benchmark.json - - - name: Store benchmark result - uses: benchmark-action/github-action-benchmark@v1 - with: - tool: 'pytest' - output-file-path: ${{ github.workspace }}/benchmark.json - github-token: ${{ secrets.GITHUB_TOKEN }} - auto-push: false - gh-pages-branch: benchmarks