55 - main
66
77 pull_request :
8- paths :
9- # test changes to Sentry SDK sources
10- - " Sources/**"
11-
12- # test changes to benchmarking implementation
13- - " Samples/iOS-Swift/**"
14- - " .github/workflows/benchmarking.yml"
15- - " .sauce/benchmarking-config.yml"
16- - " fastlane/**"
17- - " scripts/ci-select-xcode.sh"
18- - " scripts/ci-diagnostics.sh"
19- - " Samples/iOS-Swift/iOS-Swift.yml"
20- - " Samples/iOS-Swift/iOS-Swift.xcconfig"
21- - " Samples/iOS-Swift/iOS-SwiftClip.xcconfig"
22- - " Samples/iOS-Swift/iOS-Benchmarking.xcconfig"
23- - " scripts/build-xcframework-slice.sh"
24- - " scripts/assemble-xcframework.sh"
25- - " .github/workflows/build-xcframework-variant-slices.yml"
26- - " .github/workflows/assemble-xcframework-variant.yml"
278
289# Concurrency configuration:
2910# - We use workflow-specific concurrency groups to prevent multiple benchmark runs on the same code,
@@ -37,8 +18,25 @@ concurrency:
3718 cancel-in-progress : ${{ github.event_name == 'pull_request' }}
3819
3920jobs :
21+ files-changed :
22+ name : Detect File Changes
23+ runs-on : ubuntu-latest
24+ outputs :
25+ run_benchmarking_for_prs : ${{ steps.changes.outputs.run_benchmarking_for_prs }}
26+ steps :
27+ - uses : actions/checkout@v5
28+ - name : Get changed files
29+ id : changes
30+ uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
31+ with :
32+ token : ${{ github.token }}
33+ filters : .github/file-filters.yml
34+
4035 build-benchmark-test-target :
4136 name : Build App and Test Runner
37+ # Run the job only for PRs with related changes or non-PR events.
38+ if : github.event_name != 'pull_request' || needs.files-changed.outputs.run_benchmarking_for_prs == 'true'
39+ needs : files-changed
4240 runs-on : macos-14
4341 steps :
4442 - uses : actions/checkout@v5
@@ -104,8 +102,14 @@ jobs:
104102
105103 run-ui-tests-with-sauce :
106104 name : Run Benchmarks ${{matrix.suite}}
105+ # Run the job only for PRs with related changes or non-PR events.
106+ if : github.event_name != 'pull_request' || needs.files-changed.outputs.run_benchmarking_for_prs == 'true'
107107 runs-on : ubuntu-latest
108- needs : build-benchmark-test-target
108+ needs :
109+ [
110+ files-changed,
111+ build-benchmark-test-target,
112+ ]
109113 strategy :
110114 fail-fast : false
111115 matrix :
@@ -195,3 +199,22 @@ jobs:
195199 - name : Run CI Diagnostics
196200 if : failure()
197201 run : ./scripts/ci-diagnostics.sh
202+
203+ benchmarking-required-check :
204+ needs :
205+ [
206+ files-changed,
207+ build-benchmark-test-target,
208+ run-ui-tests-with-sauce,
209+ ]
210+ name : Benchmarking
211+ # This is necessary since a failed/skipped dependent job would cause this job to be skipped
212+ if : always()
213+ runs-on : ubuntu-latest
214+ steps :
215+ # If any jobs we depend on fails gets cancelled or times out, this job will fail.
216+ # Skipped jobs are not considered failures.
217+ - name : Check for failures
218+ if : contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
219+ run : |
220+ echo "One of the benchmark jobs has failed." && exit 1
0 commit comments