Skip to content

Commit 0822457

Browse files
authored
Merge 9cb5830 into 2b024aa
2 parents 2b024aa + 9cb5830 commit 0822457

File tree

1 file changed

+31
-7
lines changed

1 file changed

+31
-7
lines changed

.github/workflows/benchmarks_run.yml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,39 @@ on:
1616
required: false
1717
type: string
1818
pull_request:
19-
types: [labeled]
19+
# Add the `labeled` type to the default list.
20+
types: [labeled, opened, synchronize, reopened]
2021

2122
jobs:
23+
pre-checks:
24+
runs-on: ubuntu-latest
25+
if: github.repository == 'SciTools/iris'
26+
outputs:
27+
overnight: ${{ steps.overnight.outputs.overnight }}
28+
branch: ${{ steps.branch.outputs.branch }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 2
33+
- uses: marceloprado/has-changed-path@df1b7a3161b8fb9fd8c90403c66a9e66dfde50cb
34+
id: locks-changed
35+
with:
36+
paths: requirements/locks/*.lock
37+
- id: overnight
38+
if: github.event_name != 'pull_request'
39+
run: echo "overnight=true" >> "$GITHUB_OUTPUT"
40+
- id: branch
41+
if: >
42+
steps.locks-changed.outputs.changed == 'true'
43+
||
44+
github.event.label.name == 'benchmark_this'
45+
run: echo "branch=true" >> "$GITHUB_OUTPUT"
46+
47+
2248
benchmark:
23-
if: >
24-
github.repository == 'SciTools/iris' &&
25-
(github.event_name != 'pull_request' ||
26-
github.event.label.name == 'benchmark_this')
2749
runs-on: ubuntu-latest
50+
needs: pre-checks
51+
if: needs.pre-checks.outputs.overnight == 'true' || needs.pre-checks.outputs.branch == 'true'
2852

2953
env:
3054
IRIS_TEST_DATA_LOC_PATH: benchmarks
@@ -76,7 +100,7 @@ jobs:
76100
echo "OVERRIDE_TEST_DATA_REPOSITORY=${GITHUB_WORKSPACE}/${IRIS_TEST_DATA_PATH}/test_data" >> $GITHUB_ENV
77101
78102
- name: Benchmark this pull request
79-
if: ${{ github.event.label.name == 'benchmark_this' }}
103+
if: needs.pre-checks.outputs.branch == 'true'
80104
env:
81105
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82106
PR_NUMBER: ${{ github.event.number }}
@@ -85,7 +109,7 @@ jobs:
85109
86110
- name: Run overnight benchmarks
87111
id: overnight
88-
if: ${{ github.event_name != 'pull_request' }}
112+
if: needs.pre-checks.outputs.overnight == 'true'
89113
env:
90114
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91115
run: |

0 commit comments

Comments
 (0)