44 push :
55 branches :
66 - main
7- paths :
8- - " Sources/**"
9- - " Tests/**"
10- - " test-server/**"
11- - " Samples/**"
12- - " .github/workflows/lint-xcode-analyze.yml"
13- - " scripts/ci-select-xcode.sh"
14- - " scripts/ci-diagnostics.sh"
15-
167 pull_request :
17- paths :
18- - " Sources/**"
19- - " Tests/**"
20- - " test-server/**"
21- - " Samples/**"
22- - " .github/workflows/lint-xcode-analyze.yml"
23- - " scripts/ci-select-xcode.sh"
24- - " scripts/ci-diagnostics.sh"
25- - " Sentry.xcodeproj/**"
26- - " *.podspec"
27- - " Gemfile.lock"
288
299# Concurrency configuration:
3010# - We use workflow-specific concurrency groups to prevent multiple lint runs on the same code,
@@ -38,8 +18,25 @@ concurrency:
3818 cancel-in-progress : ${{ github.event_name == 'pull_request' }}
3919
4020jobs :
21+ files-changed :
22+ name : Detect File Changes
23+ runs-on : ubuntu-latest
24+ outputs :
25+ run_lint_xcode_analyze_for_prs : ${{ steps.changes.outputs.run_lint_xcode_analyze_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+
4135 lint :
4236 name : Lint
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_lint_xcode_analyze_for_prs == 'true'
39+ needs : files-changed
4340 runs-on : macos-15
4441 steps :
4542 - uses : actions/checkout@v5
4845 - name : Run CI Diagnostics
4946 if : failure()
5047 run : ./scripts/ci-diagnostics.sh
48+
49+ lint_xcode_analyze-required-check :
50+ needs :
51+ [
52+ files-changed,
53+ lint,
54+ ]
55+ name : Lint Xcode
56+ # This is necessary since a failed/skipped dependent job would cause this job to be skipped
57+ if : always()
58+ runs-on : ubuntu-latest
59+ steps :
60+ # If any jobs we depend on fails gets cancelled or times out, this job will fail.
61+ # Skipped jobs are not considered failures.
62+ - name : Check for failures
63+ if : contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
64+ run : |
65+ echo "One of the lint check jobs has failed." && exit 1
0 commit comments