|
1 | | -# Runs all benchmarks once when we add the `action/benchmark` tag to a pull request. |
| 1 | +# Runs all benchmarks once for a pull request. |
| 2 | +# Called from bench-dispatch.yml when the `action/benchmark` label is added. |
2 | 3 |
|
3 | 4 | name: PR Benchmarks |
4 | 5 |
|
5 | 6 | concurrency: |
6 | 7 | # The group causes runs to queue instead of running in parallel. |
7 | | - # Use a unique group for non-benchmark label events so they don't interfere with in-progress benchmark runs. |
8 | | - group: >- |
9 | | - ${{ github.workflow }}-${{ |
10 | | - github.event.label.name == 'action/benchmark' |
11 | | - && github.head_ref |
12 | | - || github.run_id |
13 | | - }} |
| 8 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
14 | 9 | # Don't cancel benchmarks that are already running, instead just queue them up. |
15 | 10 | cancel-in-progress: false |
16 | 11 |
|
17 | 12 | on: |
18 | | - pull_request: |
19 | | - types: [labeled, synchronize] |
20 | | - branches: ["develop"] |
| 13 | + workflow_call: { } |
21 | 14 | workflow_dispatch: { } |
22 | 15 |
|
23 | 16 | permissions: |
24 | | - actions: write # for removing labels |
25 | 17 | contents: read |
26 | 18 | pull-requests: write # for commenting on PRs |
27 | 19 | id-token: write # enables AWS-GitHub OIDC |
28 | 20 |
|
29 | 21 | jobs: |
30 | | - label_trigger: |
31 | | - runs-on: ubuntu-latest |
32 | | - timeout-minutes: 120 |
33 | | - if: ${{ contains(github.event.head_commit.message, '[benchmark]') || github.event.label.name == 'action/benchmark' && github.event_name == 'pull_request' }} |
34 | | - steps: |
35 | | - # We remove the benchmark label first so that the workflow can be re-triggered. |
36 | | - - uses: actions-ecosystem/action-remove-labels@v1 |
37 | | - if: ${{ github.event.pull_request.head.repo.full_name == 'vortex-data/vortex' }} |
38 | | - with: |
39 | | - labels: action/benchmark |
40 | | - fail_on_error: true |
41 | | - |
42 | 22 | bench: |
43 | | - needs: label_trigger |
44 | 23 | timeout-minutes: 120 |
45 | 24 | runs-on: >- |
46 | 25 | ${{ github.repository == 'vortex-data/vortex' |
|
54 | 33 | build_args: "--features lance" |
55 | 34 | - id: compress-bench |
56 | 35 | name: Compression |
57 | | - if: ${{ contains(github.event.head_commit.message, '[benchmark]') || github.event.label.name == 'action/benchmark' && github.event_name == 'pull_request' }} |
58 | 36 | steps: |
59 | 37 | - uses: runs-on/action@v2 |
60 | 38 | if: github.event.pull_request.head.repo.fork == false |
@@ -143,17 +121,16 @@ jobs: |
143 | 121 | comment-tag: bench-pr-comment-${{ matrix.benchmark.id }} |
144 | 122 |
|
145 | 123 | - name: Comment PR on failure |
146 | | - if: failure() && inputs.mode == 'pr' && github.event.pull_request.head.repo.fork == false |
| 124 | + if: failure() && github.event.pull_request.head.repo.fork == false |
147 | 125 | uses: thollander/actions-comment-pull-request@v3 |
148 | 126 | with: |
149 | 127 | message: | |
150 | | - # 🚨🚨🚨❌❌❌ BENCHMARK FAILED ❌❌❌🚨🚨🚨 |
| 128 | + # BENCHMARK FAILED |
151 | 129 |
|
152 | 130 | Benchmark `${{ matrix.benchmark.name }}` failed! Check the [workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details. |
153 | 131 | comment-tag: bench-pr-comment-${{ matrix.benchmark.id }} |
154 | 132 |
|
155 | 133 | sql: |
156 | | - needs: label_trigger |
157 | 134 | uses: ./.github/workflows/sql-benchmarks.yml |
158 | 135 | secrets: inherit |
159 | 136 | with: |
|
0 commit comments