From 35acd03bf7b2fe8fe7288de7a3921bff720500ac Mon Sep 17 00:00:00 2001 From: Everett Pompeii Date: Sun, 6 Oct 2024 08:40:22 -0400 Subject: [PATCH] Bencher v0.4.21 --- .github/workflows/base_benchmarks.yml | 8 ++++- .../workflows/fork_pr_benchmarks_closed.yml | 19 ++++++++++ ...chmarks.yml => fork_pr_benchmarks_run.yml} | 4 +-- ...marks.yml => fork_pr_benchmarks_track.yml} | 11 +++--- .github/workflows/pr_benchmarks.yml | 11 +++--- .github/workflows/pr_benchmarks_closed.yml | 21 +++++++++++ .github/workflows/pr_target_benchmarks.yml | 36 ------------------- README.md | 12 ++++--- 8 files changed, 68 insertions(+), 54 deletions(-) create mode 100644 .github/workflows/fork_pr_benchmarks_closed.yml rename .github/workflows/{run_fork_pr_benchmarks.yml => fork_pr_benchmarks_run.yml} (90%) rename .github/workflows/{track_fork_pr_benchmarks.yml => fork_pr_benchmarks_track.yml} (88%) create mode 100644 .github/workflows/pr_benchmarks_closed.yml delete mode 100644 .github/workflows/pr_target_benchmarks.yml diff --git a/.github/workflows/base_benchmarks.yml b/.github/workflows/base_benchmarks.yml index 8f53405..76d717c 100644 --- a/.github/workflows/base_benchmarks.yml +++ b/.github/workflows/base_benchmarks.yml @@ -16,6 +16,12 @@ jobs: --token '${{ secrets.BENCHER_API_TOKEN }}' \ --branch main \ --testbed ubuntu-latest \ - --adapter json \ + --threshold-measure latency \ + --threshold-test t_test \ + --threshold-max-sample-size 64 \ + --threshold-upper-boundary 0.99 \ + --thresholds-reset \ --err \ + --adapter json \ + --github-actions '${{ secrets.GITHUB_TOKEN }}' \ bencher mock diff --git a/.github/workflows/fork_pr_benchmarks_closed.yml b/.github/workflows/fork_pr_benchmarks_closed.yml new file mode 100644 index 0000000..bd69e3c --- /dev/null +++ b/.github/workflows/fork_pr_benchmarks_closed.yml @@ -0,0 +1,19 @@ +on: + pull_request: + types: [closed] + +jobs: + archive_fork_pr_branch: + name: Archive closed fork PR branch with Bencher + permissions: + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: bencherdev/bencher@main + - name: Archive closed fork PR branch with Bencher + run: | + bencher archive \ + --project example \ + --token '${{ secrets.BENCHER_API_TOKEN }}' \ + --branch '${{ github.head_ref }}' diff --git a/.github/workflows/run_fork_pr_benchmarks.yml b/.github/workflows/fork_pr_benchmarks_run.yml similarity index 90% rename from .github/workflows/run_fork_pr_benchmarks.yml rename to .github/workflows/fork_pr_benchmarks_run.yml index d89ed14..7541d6d 100644 --- a/.github/workflows/run_fork_pr_benchmarks.yml +++ b/.github/workflows/fork_pr_benchmarks_run.yml @@ -1,4 +1,4 @@ -name: Run and Cache Benchmarks +name: Run Benchmarks on: pull_request: @@ -22,4 +22,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: event.json - path: ${{ github.event_path }} \ No newline at end of file + path: ${{ github.event_path }} diff --git a/.github/workflows/track_fork_pr_benchmarks.yml b/.github/workflows/fork_pr_benchmarks_track.yml similarity index 88% rename from .github/workflows/track_fork_pr_benchmarks.yml rename to .github/workflows/fork_pr_benchmarks_track.yml index 134b9a9..22e41ac 100644 --- a/.github/workflows/track_fork_pr_benchmarks.yml +++ b/.github/workflows/fork_pr_benchmarks_track.yml @@ -2,7 +2,7 @@ name: Track Benchmarks with Bencher on: workflow_run: - workflows: [Run and Cache Benchmarks] + workflows: [Run Benchmarks] types: [completed] jobs: @@ -40,12 +40,13 @@ jobs: --project example \ --token '${{ secrets.BENCHER_API_TOKEN }}' \ --branch '${{ env.PR_HEAD }}' \ - --branch-start-point '${{ env.PR_BASE }}' \ - --branch-start-point-hash '${{ env.PR_BASE_SHA }}' \ - --branch-reset \ + --start-point '${{ env.PR_BASE }}' \ + --start-point-hash '${{ env.PR_BASE_SHA }}' \ + --start-point-clone-thresholds \ + --start-point-reset \ --testbed ubuntu-latest \ - --adapter json \ --err \ + --adapter json \ --github-actions '${{ secrets.GITHUB_TOKEN }}' \ --ci-number '${{ env.PR_NUMBER }}' \ --file "$BENCHMARK_RESULTS" diff --git a/.github/workflows/pr_benchmarks.yml b/.github/workflows/pr_benchmarks.yml index f84e0d4..6a29469 100644 --- a/.github/workflows/pr_benchmarks.yml +++ b/.github/workflows/pr_benchmarks.yml @@ -19,11 +19,12 @@ jobs: --project example \ --token '${{ secrets.BENCHER_API_TOKEN }}' \ --branch '${{ github.head_ref }}' \ - --branch-start-point '${{ github.base_ref }}' \ - --branch-start-point-hash '${{ github.event.pull_request.base.sha }}' \ - --branch-reset \ + --start-point '${{ github.base_ref }}' \ + --start-point-hash '${{ github.event.pull_request.base.sha }}' \ + --start-point-clone-thresholds \ + --start-point-reset \ --testbed ubuntu-latest \ - --adapter json \ --err \ + --adapter json \ --github-actions '${{ secrets.GITHUB_TOKEN }}' \ - bencher mock \ No newline at end of file + bencher mock diff --git a/.github/workflows/pr_benchmarks_closed.yml b/.github/workflows/pr_benchmarks_closed.yml new file mode 100644 index 0000000..cd411e0 --- /dev/null +++ b/.github/workflows/pr_benchmarks_closed.yml @@ -0,0 +1,21 @@ +on: + pull_request: + types: [closed] + +jobs: + archive_pr_branch: + name: Archive closed PR branch with Bencher + # DO NOT REMOVE: For handling Fork PRs see Pull Requests from Forks + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository + permissions: + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: bencherdev/bencher@main + - name: Archive closed PR branch with Bencher + run: | + bencher archive \ + --project example \ + --token '${{ secrets.BENCHER_API_TOKEN }}' \ + --branch '${{ github.head_ref }}' diff --git a/.github/workflows/pr_target_benchmarks.yml b/.github/workflows/pr_target_benchmarks.yml deleted file mode 100644 index e4741e0..0000000 --- a/.github/workflows/pr_target_benchmarks.yml +++ /dev/null @@ -1,36 +0,0 @@ -on: - pull_request_target: - types: [opened, reopened, edited, synchronize] - -jobs: - fork_pr_requires_review: - environment: ${{ (github.event.pull_request.head.repo.full_name == github.repository && 'internal') || 'external' }} - runs-on: ubuntu-latest - steps: - - run: true - - benchmark_fork_pr_branch: - needs: fork_pr_requires_review - name: Continuous Benchmarking Fork PRs with Bencher - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.event.pull_request.head.sha }} - persist-credentials: false - - uses: bencherdev/bencher@main - - name: Track Fork PR Benchmarks with Bencher - run: | - bencher run \ - --project example \ - --token '${{ secrets.BENCHER_API_TOKEN }}' \ - --branch '${{ github.event.number }}/merge' \ - --branch-start-point '${{ github.base_ref }}' \ - --branch-start-point-hash '${{ github.event.pull_request.base.sha }}' \ - --branch-reset \ - --testbed ubuntu-latest \ - --adapter json \ - --err \ - --github-actions '${{ secrets.GITHUB_TOKEN }}' \ - bencher mock \ No newline at end of file diff --git a/README.md b/README.md index 627fe6a..cc43c48 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,10 @@ The `.github` directory contains example workflows from [how to use Bencher in GitHub Actions](https://bencher.dev/docs/how-to/github-actions/). - [Benchmark pushes to `main` branch](.github/workflows/base_benchmarks.yml) -- [Benchmark pull requests from branches](.github/workflows/pr_benchmarks.yml) -- Benchmark fork pull requests and upload from default branch - - [Run benchmarks and cache](.github/workflows/run_fork_pr_benchmarks.yml) - - [Track benchmarks](.github/workflows/track_fork_pr_benchmarks.yml) -- [Benchmark fork pull requests with Required Reviewers](.github/workflows/pr_target_benchmarks.yml) +- Benchmark pull requests + - [Run and track benchmarks](.github/workflows/pr_benchmarks.yml) + - [Archive branches for closed pull requests](.github/workflows/pr_benchmarks_closed.yml) +- Benchmark pull requests from forks + - [Run benchmarks](.github/workflows/fork_pr_benchmarks_run.yml) + - [Track benchmarks](.github/workflows/fork_pr_benchmarks_track.yml) + - [Archive branches for closed pull requests from forks](.github/workflows/fork_pr_benchmarks_closed.yml)