17
17
- " .swiftlint.yml"
18
18
19
19
pull_request :
20
- paths :
21
- - " Sources/**"
22
- - " Tests/**"
23
- - " test-server/**"
24
- - " Samples/**"
25
- - " .github/workflows/lint-cocoapods-specs.yml"
26
- - " scripts/ci-select-xcode.sh"
27
- - " scripts/ci-diagnostics.sh"
28
- - " Sentry.xcodeproj/**"
29
- - " *.podspec"
30
- - " Gemfile.lock"
31
- - " Makefile" # Make commands used for linting setup
32
- - " Brewfile*" # Tools installation affects linting environment
33
- - " .swiftlint.yml"
34
20
35
21
# Concurrency configuration:
36
22
# - We use workflow-specific concurrency groups to prevent multiple lint runs on the same code,
@@ -44,8 +30,25 @@ concurrency:
44
30
cancel-in-progress : ${{ github.event_name == 'pull_request' }}
45
31
46
32
jobs :
33
+ files-changed :
34
+ name : Detect File Changes
35
+ runs-on : ubuntu-latest
36
+ outputs :
37
+ run_lint_cocoapods_Specs_for_prs : ${{ steps.changes.outputs.run_lint_cocoapods_Specs_for_prs }}
38
+ steps :
39
+ - uses : actions/checkout@v5
40
+ - name : Get changed files
41
+ id : changes
42
+ uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
43
+ with :
44
+ token : ${{ github.token }}
45
+ filters : .github/file-filters.yml
46
+
47
47
lint-podspec :
48
48
name : ${{ matrix.podspec}} ${{ matrix.library_type }} ${{ matrix.platform}}
49
+ # Run the job only for PRs with related changes or non-PR events.
50
+ if : github.event_name != 'pull_request' || needs.files-changed.outputs.run_lint_cocoapods_Specs_for_prs == 'true'
51
+ needs : files-changed
49
52
runs-on : macos-14
50
53
strategy :
51
54
fail-fast : false
67
70
68
71
lint-hybrid-sdk-podspec :
69
72
name : Sentry/HybridSDK
73
+ # Run the job only for PRs with related changes or non-PR events.
74
+ if : github.event_name != 'pull_request' || needs.files-changed.outputs.run_lint_cocoapods_Specs_for_prs == 'true'
75
+ needs : files-changed
70
76
runs-on : macos-14
71
77
72
78
steps :
78
84
- name : Run CI Diagnostics
79
85
if : failure()
80
86
run : ./scripts/ci-diagnostics.sh
87
+
88
+ lint_cocoapods_Specs-required-check :
89
+ needs :
90
+ [
91
+ files-changed,
92
+ lint-podspec,
93
+ lint-hybrid-sdk-podspec,
94
+ ]
95
+ name : Lint CocoaPods Specs
96
+ # This is necessary since a failed/skipped dependent job would cause this job to be skipped
97
+ if : always()
98
+ runs-on : ubuntu-latest
99
+ steps :
100
+ # If any jobs we depend on fails gets cancelled or times out, this job will fail.
101
+ # Skipped jobs are not considered failures.
102
+ - name : Check for failures
103
+ if : contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
104
+ run : |
105
+ echo "One of the CocoaPods specs linting jobs has failed." && exit 1
0 commit comments