Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/file-filters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,27 @@ run_api_stability_for_prs: &run_api_stability_for_prs # API-related code
- "Makefile" # Make commands used for API generation
- "sdk_api.json"
- "sdk_api_v9.json"

run_lint_cocoapods_Specs_for_prs: &run_lint_cocoapods_Specs_for_prs # CocoaPods specs linting
- "Sources/**"
- "Tests/**"
- "test-server/**"
- "Samples/**"

# GH Actions
- ".github/workflows/lint-cocoapods-specs.yml"
- ".github/file-filters.yml"

# Scripts
- "scripts/ci-select-xcode.sh"
- "scripts/ci-diagnostics.sh"

# Project files
- "Sentry.xcodeproj/**"
- "*.podspec"
- "Gemfile.lock"

# Other
- "Makefile" # Make commands used for linting setup
- "Brewfile*" # Tools installation affects linting environment
- ".swiftlint.yml"
53 changes: 39 additions & 14 deletions .github/workflows/lint-cocoapods-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,6 @@ on:
- ".swiftlint.yml"

pull_request:
paths:
- "Sources/**"
- "Tests/**"
- "test-server/**"
- "Samples/**"
- ".github/workflows/lint-cocoapods-specs.yml"
- "scripts/ci-select-xcode.sh"
- "scripts/ci-diagnostics.sh"
- "Sentry.xcodeproj/**"
- "*.podspec"
- "Gemfile.lock"
- "Makefile" # Make commands used for linting setup
- "Brewfile*" # Tools installation affects linting environment
- ".swiftlint.yml"

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

jobs:
files-changed:
name: Detect File Changes
runs-on: ubuntu-latest
outputs:
run_lint_cocoapods_Specs_for_prs: ${{ steps.changes.outputs.run_lint_cocoapods_Specs_for_prs }}
steps:
- uses: actions/checkout@v5
- name: Get changed files
id: changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
with:
token: ${{ github.token }}
filters: .github/file-filters.yml

lint-podspec:
name: ${{ matrix.podspec}} ${{ matrix.library_type }} ${{ matrix.platform}}
# Run the job only for PRs with related changes or non-PR events.
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_lint_cocoapods_Specs_for_prs == 'true'
needs: files-changed
runs-on: macos-14
strategy:
fail-fast: false
Expand All @@ -67,6 +70,9 @@ jobs:

lint-hybrid-sdk-podspec:
name: Sentry/HybridSDK
# Run the job only for PRs with related changes or non-PR events.
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_lint_cocoapods_Specs_for_prs == 'true'
needs: files-changed
runs-on: macos-14

steps:
Expand All @@ -78,3 +84,22 @@ jobs:
- name: Run CI Diagnostics
if: failure()
run: ./scripts/ci-diagnostics.sh

lint_cocoapods_Specs-required-check:
needs:
[
files-changed,
lint-podspec,
lint-hybrid-sdk-podspec,
]
name: Lint CocoaPods Specs
# This is necessary since a failed/skipped dependent job would cause this job to be skipped
if: always()
runs-on: ubuntu-latest
steps:
# If any jobs we depend on fails gets cancelled or times out, this job will fail.
# Skipped jobs are not considered failures.
- name: Check for failures
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "One of the CocoaPods specs linting jobs has failed." && exit 1
Loading