|
16 | 16 | required: false
|
17 | 17 | type: string
|
18 | 18 | pull_request:
|
19 |
| - types: [labeled] |
| 19 | + # Add the `labeled` type to the default list. |
| 20 | + types: [labeled, opened, synchronize, reopened] |
20 | 21 |
|
21 | 22 | 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 | + |
22 | 48 | benchmark:
|
23 |
| - if: > |
24 |
| - github.repository == 'SciTools/iris' && |
25 |
| - (github.event_name != 'pull_request' || |
26 |
| - github.event.label.name == 'benchmark_this') |
27 | 49 | runs-on: ubuntu-latest
|
| 50 | + needs: pre-checks |
| 51 | + if: needs.pre-checks.outputs.overnight == 'true' || needs.pre-checks.outputs.branch == 'true' |
28 | 52 |
|
29 | 53 | env:
|
30 | 54 | IRIS_TEST_DATA_LOC_PATH: benchmarks
|
|
76 | 100 | echo "OVERRIDE_TEST_DATA_REPOSITORY=${GITHUB_WORKSPACE}/${IRIS_TEST_DATA_PATH}/test_data" >> $GITHUB_ENV
|
77 | 101 |
|
78 | 102 | - name: Benchmark this pull request
|
79 |
| - if: ${{ github.event.label.name == 'benchmark_this' }} |
| 103 | + if: needs.pre-checks.outputs.branch == 'true' |
80 | 104 | env:
|
81 | 105 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
82 | 106 | PR_NUMBER: ${{ github.event.number }}
|
|
85 | 109 |
|
86 | 110 | - name: Run overnight benchmarks
|
87 | 111 | id: overnight
|
88 |
| - if: ${{ github.event_name != 'pull_request' }} |
| 112 | + if: needs.pre-checks.outputs.overnight == 'true' |
89 | 113 | env:
|
90 | 114 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
91 | 115 | run: |
|
|
0 commit comments