Skip to content

Commit 2299e52

Browse files
committed
Merge remote-tracking branch 'origin/main' into cursor/implement-required-checks-for-benchmarking-923d
2 parents 04ffb79 + 0ede342 commit 2299e52

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+677
-281
lines changed

.github/file-filters.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,110 @@ run_benchmarking_for_prs: &run_benchmarking_for_prs
8484
- "Samples/iOS-Swift/iOS-SwiftClip.xcconfig"
8585
- "Samples/iOS-Swift/iOS-Benchmarking.xcconfig"
8686

87+
run_objc_conversion_analysis_for_prs: &run_objc_conversion_analysis_for_prs
88+
- "SwiftConversion/**"
89+
90+
# GH Actions
91+
- ".github/workflows/objc-conversion-analysis.yml"
92+
- ".github/file-filters.yml"
93+
94+
# Scripts
95+
- "scripts/ci-diagnostics.sh"
96+
97+
run_auto_update_tools_for_prs: &run_auto_update_tools_for_prs # Auto-update tools workflow
98+
# Formatting
99+
- ".pre-commit-config.yaml"
100+
101+
# GH Actions
102+
- ".github/workflows/auto-update-tools.yml"
103+
104+
# Scripts
105+
- "scripts/.clang-format-version"
106+
- "scripts/.swiftlint-version"
107+
- "scripts/check-tooling-versions.sh"
108+
- "scripts/ci-diagnostics.sh"
109+
- "scripts/update-tooling-versions.sh"
110+
111+
# Other
112+
- "Brewfile*"
113+
- "Makefile"
114+
115+
run_lint_cocoapods_specs_for_prs: &run_lint_cocoapods_specs_for_prs # CocoaPods specs linting
116+
- "Sources/**"
117+
- "Tests/**"
118+
- "test-server/**"
119+
- "Samples/**"
120+
121+
# GH Actions
122+
- ".github/workflows/lint-cocoapods-specs.yml"
123+
- ".github/file-filters.yml"
124+
125+
# Scripts
126+
- "scripts/ci-select-xcode.sh"
127+
- "scripts/ci-diagnostics.sh"
128+
129+
# Project files
130+
- "Sentry.xcodeproj/**"
131+
- "*.podspec"
132+
- "Gemfile.lock"
133+
134+
# Other
135+
- "Makefile" # Make commands used for linting setup
136+
- "Brewfile*" # Tools installation affects linting environment
137+
- ".swiftlint.yml"
138+
139+
run_release_for_prs: &run_release_for_prs # Release-related code
140+
- "Sources/**"
141+
87142
# Scripts
88143
- "scripts/ci-select-xcode.sh"
89144
- "scripts/ci-diagnostics.sh"
90145
- "scripts/build-xcframework-slice.sh"
91146
- "scripts/assemble-xcframework.sh"
147+
148+
# Project files
149+
- "Sentry.xcworkspace/**"
150+
- "Sentry.xcodeproj/**"
151+
- "Package*.swift"
152+
153+
# GH Actions
154+
- ".github/workflows/build-xcframework.yml"
155+
- ".github/workflows/release.yml"
156+
- ".github/workflows/build-xcframework-variant-slices.yml"
157+
- ".github/workflows/assemble-xcframework-variant.yml"
158+
- ".github/workflows/ui-tests-common.yml"
159+
- ".github/file-filters.yml"
160+
161+
# Samples
162+
- "Samples/macOS-SPM-CommandLine/**"
163+
- "Samples/SPM-Dynamic/**"
164+
165+
run_lint_swift_formatting_for_prs: &run_lint_swift_formatting_for_prs # Swift formatting
166+
- "**/*.swift"
167+
168+
# GH Actions
169+
- ".github/workflows/lint-swift-formatting.yml"
170+
- ".github/file-filters.yml"
171+
172+
# Formatting
173+
- ".swiftlint.yml"
174+
175+
# Other
176+
- "Makefile" # Make commands used for formatting setup
177+
- "Brewfile*" # Tools installation affects formatting environment
178+
179+
# Scripts
180+
- "scripts/ci-diagnostics.sh"
181+
182+
run_lint_dprint_for_prs: &run_lint_dprint_for_prs # dprint formatting
183+
- "**/*.yml"
184+
- "**/*.yaml"
185+
- "**/*.json"
186+
- "**/*.md"
187+
188+
# Formatting
189+
- "dprint.json"
190+
191+
# GH Actions
192+
- ".github/workflows/lint-dprint-formatting.yml"
193+
- ".github/file-filters.yml"

.github/workflows/auto-update-tools.yml

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@ on:
1212
- cron: "0 0 * * *"
1313
workflow_dispatch:
1414
pull_request:
15-
paths:
16-
- ".github/workflows/auto-update-tools.yml"
17-
- "Brewfile*"
18-
- "Makefile"
19-
- "scripts/.clang-format-version"
20-
- "scripts/.swiftlint-version"
21-
- ".pre-commit-config.yaml"
22-
- "scripts/update-tooling-versions.sh"
23-
- "scripts/check-tooling-versions.sh"
24-
- "scripts/ci-diagnostics.sh"
2515

2616
# Permissions configuration:
2717
# - 'contents: write' is required to allow the workflow to commit changes to the repository
@@ -46,7 +36,29 @@ concurrency:
4636
cancel-in-progress: true
4737

4838
jobs:
39+
# This job detects if the PR contains changes that require running auto-update-tools.
40+
# If yes, the job will output a flag that will be used by the next job to run the auto-update-tools.
41+
# If no, the job will output a flag that will be used by the next job to skip running the auto-update-tools.
42+
# At the end of this workflow, we run a check that validates that either auto_update_tools-required-check passed or were
43+
# skipped, which is called auto_update_tools-required-check.
44+
files-changed:
45+
name: Detect File Changes
46+
runs-on: ubuntu-latest
47+
# Map a step output to a job output
48+
outputs:
49+
run_auto_update_tools_for_prs: ${{ steps.changes.outputs.run_auto_update_tools_for_prs }}
50+
steps:
51+
- uses: actions/checkout@v5
52+
- name: Get changed files
53+
id: changes
54+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
55+
with:
56+
token: ${{ github.token }}
57+
filters: .github/file-filters.yml
58+
4959
auto-update-tools:
60+
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_auto_update_tools_for_prs == 'true'
61+
needs: files-changed
5062
runs-on: macos-15
5163
steps:
5264
- name: Checkout Repository
@@ -96,3 +108,24 @@ jobs:
96108
- name: Run CI Diagnostics
97109
if: failure()
98110
run: ./scripts/ci-diagnostics.sh
111+
112+
# This check validates that either auto-update-tools passed or was skipped, which allows us
113+
# to make auto-update-tools a required check with only running the auto-update-tools when required.
114+
# So, we don't have to run auto-update-tools, for example, for unrelated changes.
115+
auto_update_tools-required-check:
116+
needs:
117+
[
118+
files-changed,
119+
auto-update-tools,
120+
]
121+
name: Auto Update Tools
122+
# This is necessary since a failed/skipped dependent job would cause this job to be skipped
123+
if: always()
124+
runs-on: ubuntu-latest
125+
steps:
126+
# If any jobs we depend on fails gets cancelled or times out, this job will fail.
127+
# Skipped jobs are not considered failures.
128+
- name: Check for failures
129+
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
130+
run: |
131+
echo "One of the auto-update-tools jobs has failed." && exit 1

.github/workflows/lint-cocoapods-specs.yml

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,6 @@ on:
1717
- ".swiftlint.yml"
1818

1919
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"
3420

3521
# Concurrency configuration:
3622
# - We use workflow-specific concurrency groups to prevent multiple lint runs on the same code,
@@ -44,8 +30,25 @@ concurrency:
4430
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
4531

4632
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+
4747
lint-podspec:
4848
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
4952
runs-on: macos-14
5053
strategy:
5154
fail-fast: false
@@ -67,6 +70,9 @@ jobs:
6770

6871
lint-hybrid-sdk-podspec:
6972
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
7076
runs-on: macos-14
7177

7278
steps:
@@ -78,3 +84,22 @@ jobs:
7884
- name: Run CI Diagnostics
7985
if: failure()
8086
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

.github/workflows/lint-dprint-formatting.yml

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,8 @@ on:
88
push:
99
branches:
1010
- main
11-
paths:
12-
- "**/*.yml"
13-
- "**/*.yaml"
14-
- "**/*.json"
15-
- "**/*.md"
16-
- ".github/workflows/lint-dprint-formatting.yml"
17-
- "dprint.json"
1811

1912
pull_request:
20-
paths:
21-
- "**/*.yml"
22-
- "**/*.yaml"
23-
- "**/*.json"
24-
- "**/*.md"
25-
- ".github/workflows/lint-dprint-formatting.yml"
26-
- "dprint.json"
2713

2814
# Concurrency configuration:
2915
# - We use workflow-specific concurrency groups to prevent multiple lint runs on the same code,
@@ -37,9 +23,44 @@ concurrency:
3723
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
3824

3925
jobs:
26+
files-changed:
27+
name: Detect File Changes
28+
runs-on: ubuntu-latest
29+
outputs:
30+
run_lint_dprint_for_prs: ${{ steps.changes.outputs.run_lint_dprint_for_prs }}
31+
steps:
32+
- uses: actions/checkout@v5
33+
- name: Get changed files
34+
id: changes
35+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
36+
with:
37+
token: ${{ github.token }}
38+
filters: .github/file-filters.yml
39+
4040
lint:
4141
name: Lint
42+
# Run the job only for PRs with related changes or non-PR events.
43+
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_lint_dprint_for_prs == 'true'
44+
needs: files-changed
4245
runs-on: ubuntu-latest
4346
steps:
4447
- uses: actions/checkout@v5
4548
- uses: dprint/check@v2.3
49+
50+
lint-dprint-required-check:
51+
needs:
52+
[
53+
files-changed,
54+
lint,
55+
]
56+
name: Lint dprint
57+
# This is necessary since a failed/skipped dependent job would cause this job to be skipped
58+
if: always()
59+
runs-on: ubuntu-latest
60+
steps:
61+
# If any jobs we depend on fails gets cancelled or times out, this job will fail.
62+
# Skipped jobs are not considered failures.
63+
- name: Check for failures
64+
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
65+
run: |
66+
echo "One of the lint dprint jobs has failed." && exit 1

0 commit comments

Comments
 (0)