-
-
Notifications
You must be signed in to change notification settings - Fork 377
chore: Add dedicated CI workflow for 3rd-party integrations #6945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
itaybre
wants to merge
82
commits into
main
Choose a base branch
from
itay/add_ci_tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+149
−132
Open
Changes from all commits
Commits
Show all changes
82 commits
Select commit
Hold shift + click to select a range
8f396d4
Add `SenrtySwiftLog` integration
denrase 2e79d06
Add default `swift package init` .gitignore
denrase f4c75d2
chore: Add test workflow for swift log
itaybre 5c5779f
Add macOS version
itaybre 01001dc
Remove file-filter
itaybre 2e9908c
Update integration's package to use local path
itaybre c3a610e
Merge branch 'main' into feat/add-swift-log-integration
denrase 9fdbc39
Add ci job to run test
denrase b096852
Add files-changed gate
denrase b00d89e
Fix example commands
itaybre c0d95c7
Add SPM test to required checks
itaybre d1851a8
Merge branch 'main' into feat/add-swift-log-integration
denrase 5a72187
update folder structure
denrase 2077ce0
update name
denrase 6516a2e
Update `sentry-xcodebuild.sh` to be compatible with SPM packages
itaybre 7ab3886
Add `--update-path-to-sentry-cocoa` to prepare-package.sh
itaybre 77e3f6e
Improve script
itaybre 6636b7b
Reuse existing `unit-test-common.yml`
itaybre a12905b
Fix path
itaybre 6ed3e63
Update GitHub Actions workflow to use 'runs-on' for macOS version
itaybre bb5691d
Remove unnecesary files
itaybre 8171057
Add missing parameters
itaybre 870d82f
Update GitHub Actions workflow to correct script path for package pre…
itaybre 14d9475
Add debugging steps to unit-test-common.yml for improved visibility d…
itaybre 91ec7b7
Merge branch 'feat/add-swift-log-integration' of github.com:getsentry…
itaybre b063217
Update paths
itaybre e7db089
Update path
itaybre 4162a71
Update path in prepare-package.sh for Sentry Cocoa package reference
itaybre 2fd7b3f
Add support for testing SPM packages in CI workflows
itaybre 250507b
Add comment
itaybre 237c86f
Merge branch 'main' into itay/add_ci_tests
denrase ca504ad
delete old/unused fils from previous merge
denrase 0760a51
Changed the working directory for SwiftLog integration to SentrySwift…
denrase 86955fd
- Introduced a new workflow for testing 3rd-party integrations, conso…
denrase 32fcad3
Updated the variable name from `path_to_scripts_folder` to `scripts_d…
denrase ac0c4f5
Update actions/checkout version in 3rd-party integrations workflow to…
denrase f479878
Add tests for SentrySwiftyBeaver, SentryCocoaLumberjack, and SentryPu…
denrase 0206965
Rename and update the Xcode integration test job to `test-integration…
denrase 3fe0e0e
Merge branch 'main' into itay/add_ci_tests
denrase 4f65361
Update SPM project option handling in sentry-xcodebuild.sh to accept …
denrase 837d9cd
Add default working directory to unit test workflow configuration for…
denrase d4e24cf
Fix call for --spm-project to use missing param
denrase 53f541d
Inherit secrets in the 3rd-party integrations workflow
denrase 4c633d8
Enhance unit test workflow by specifying working directory for code c…
denrase 108e5ba
diable slather for spm xcodebuild, as we don't have xcodeproj files
denrase 6726660
dont upload codecov
denrase d20cf5d
bump to 18.5
denrase a5ba1cd
bump rest to 18.5
denrase 583438c
Update artifact naming in unit test workflow to include scheme for be…
denrase 34cda66
use working dir in Run CI Diagnostics
denrase 4e3ba2e
Merge branch 'main' into itay/add_ci_tests
denrase 0b4b169
Update name groupings
denrase 8c6c320
Merge branch 'main' into itay/add_ci_tests
denrase cbe2906
Merge branch 'itay/add_ci_tests' of github.com:getsentry/sentry-cocoa…
denrase 6f6e7f1
UPdate name job grouping
denrase d260bcf
update naming
denrase ff73067
Merge branch 'main' into itay/add_ci_tests
denrase f6abcc3
Merge branch 'main' into itay/add_ci_tests
denrase 3d4f9bb
trigger 3rd-party integration tests on source changes
denrase 88f0770
reduce number of runs
denrase 379958a
test third-party integrations against pre-build artefacts instead of …
denrase 26bc1c5
Only build one static target
denrase 4015713
handle local artifacts in shared workflow
denrase 47e59a1
fix path
denrase 79529f1
build sim slice
denrase a0d342b
Merge branch 'main' into itay/add_ci_tests
denrase edd2172
use inputs.working_directory for raw logs and archiving test results
denrase c115fa7
Merge branch 'itay/add_ci_tests' of github.com:getsentry/sentry-cocoa…
denrase ce7cc6e
add build-xcframeworks to required check
denrase 126f92c
Merge branch 'main' into itay/add_ci_tests
denrase 2495634
remove install + create (like on main)
denrase 40979a0
revert SKIP_SWIFTLINT
denrase 7f8d16a
add simulatorAndmacOSOnly to build-xcframework-local.sh
denrase 06387f2
use sed intead of swift package edit
denrase e785700
include all related scripts to file filter
denrase 1d8c11f
minor improvements
denrase 72cd026
remove unneeded scripts dir argument
denrase f096304
don’t install slather for som build
denrase b6f9f4b
only run spm tests, revert changes to shared tests workflow and build…
denrase 63cb6ee
use macOSOnly
denrase 9df643b
Merge branch 'main' into itay/add_ci_tests
itaybre 152c638
Merge branch 'main' into itay/add_ci_tests
denrase File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| name: Test 3rd Party Integrations | ||
denrase marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - release/** | ||
|
|
||
| pull_request: | ||
| types: [opened, synchronize, reopened, labeled] | ||
|
|
||
| # Concurrency configuration: | ||
| # - We use workflow-specific concurrency groups to allow independent test runs across different workflows | ||
| # while preventing multiple runs of the same test suite on the same branch/commit. | ||
| # - For pull requests, we cancel in-progress runs when new commits are pushed to save CI resources | ||
| # and provide faster feedback on the latest changes. | ||
| # - For main branch pushes and scheduled runs, we never cancel in-progress runs to ensure the complete | ||
| # test suite always finishes, maintaining the integrity of our main branch quality gates. | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| jobs: | ||
| ready-to-merge-gate: | ||
| name: Ready-to-merge gate | ||
| uses: ./.github/workflows/ready-to-merge-workflow.yml | ||
|
|
||
| # This job detects if the PR contains changes that require running tests for 3rd-party integrations. | ||
| # If yes, the job will output a flag that will be used by the next job to run the tests for 3rd-party integrations. | ||
| # If no, the job will output a flag that will be used by the next job to skip running the tests for 3rd-party integrations. | ||
| # At the end of this workflow, we run a check that validates that either all tests for 3rd-party integrations passed or were | ||
| # called unit-tests-required-check. | ||
| files-changed: | ||
| name: Detect File Changes | ||
| runs-on: ubuntu-latest | ||
| needs: ready-to-merge-gate | ||
| # Map a step output to a job output | ||
| outputs: | ||
| run_3rd_party_integrations_tests_for_prs: ${{ steps.changes.outputs.run_3rd_party_integrations_tests_for_prs }} | ||
| steps: | ||
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | ||
| - name: Get changed files | ||
| id: changes | ||
| uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | ||
| with: | ||
| token: ${{ github.token }} | ||
| filters: .github/file-filters.yml | ||
|
|
||
| # Build xcframeworks from source code once for all integration tests. | ||
| # This ensures tests use the current source code instead of the latest GitHub release. | ||
| # We only build the Static variant since 3rd-party integrations only use the "Sentry" product. | ||
| # Intentionally skipped on release branches. | ||
| build-xcframeworks: | ||
| name: Build XCFrameworks | ||
| needs: files-changed | ||
| if: startsWith(github.ref, 'refs/heads/release/') == false && (github.event_name != 'pull_request' || needs.files-changed.outputs.run_3rd_party_integrations_tests_for_prs == 'true') | ||
| runs-on: ["ghcr.io/cirruslabs/macos-runner:sequoia", "runner_group_id:10"] | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | ||
| - name: Select Xcode | ||
| run: ./scripts/ci-select-xcode.sh 16.4 | ||
| - name: Build XCFramework (Static) | ||
| run: ./scripts/build-xcframework-local.sh macOSOnly StaticOnly --not-signed | ||
| - name: Upload XCFrameworks | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: xcframeworks-for-3rd-party-integration-tests | ||
| path: "XCFrameworkBuildPath/*.xcframework.zip" | ||
| retention-days: 1 | ||
|
|
||
| # SPM tests for all 3rd-party integrations | ||
| test-integrations-spm: | ||
| name: SPM Tests | ${{matrix.integration_dir}} | ||
| needs: [files-changed, build-xcframeworks] | ||
| if: startsWith(github.ref, 'refs/heads/release/') == false && (github.event_name != 'pull_request' || needs.files-changed.outputs.run_3rd_party_integrations_tests_for_prs == 'true') | ||
| runs-on: ["ghcr.io/cirruslabs/macos-runner:sequoia", "runner_group_id:10"] | ||
| timeout-minutes: 30 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - integration_dir: SentrySwiftLog | ||
| - integration_dir: SentrySwiftyBeaver | ||
| - integration_dir: SentryCocoaLumberjack | ||
| - integration_dir: SentryPulse | ||
| steps: | ||
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | ||
| - name: Select Xcode | ||
| run: ./scripts/ci-select-xcode.sh 16.4 | ||
| - name: Download XCFrameworks | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| name: xcframeworks-for-3rd-party-integration-tests | ||
| - name: Modify Package.swift to use local xcframeworks | ||
| run: ./scripts/prepare-package.sh --package-file Package.swift --is-pr true --remove-duplicate true --change-path true | ||
| - name: Use local sentry-cocoa | ||
| working-directory: 3rd-party-integrations/${{matrix.integration_dir}} | ||
| run: | | ||
| sed -i '' 's|\.package(url: "https://github\.com/getsentry/sentry-cocoa", from: "[^"]*")|.package(name: "sentry-cocoa", path: "../..")|g' Package.swift | ||
| - name: Run SPM Tests | ||
| working-directory: 3rd-party-integrations/${{matrix.integration_dir}} | ||
| run: swift test | ||
| - name: Archiving Raw Logs | ||
| uses: actions/upload-artifact@v6 | ||
| if: ${{ failure() || cancelled() }} | ||
| with: | ||
| name: raw-output-${{matrix.integration_dir}}-integration | ||
| path: | | ||
| 3rd-party-integrations/${{matrix.integration_dir}}/.build/**/*.log | ||
| - name: Run CI Diagnostics | ||
| if: failure() | ||
| run: ./scripts/ci-diagnostics.sh | ||
|
|
||
| unit-tests-required-check: | ||
| needs: | ||
| [ | ||
| ready-to-merge-gate, | ||
| files-changed, | ||
| build-xcframeworks, | ||
| test-integrations-spm, | ||
| ] | ||
cursor[bot] marked this conversation as resolved.
Show resolved
Hide resolved
denrase marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| name: 3rd Party Integration Tests - Required Check | ||
| # 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 3rd party integration test jobs has failed." && exit 1 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stale filter triggers unnecessary unit test CI runs
Low Severity
The
3rd-party-integrations/**entry remains in therun_unit_tests_for_prsfilter even though all integration test jobs were removed fromtest.yml. This means PRs that only modify files in3rd-party-integrations/will unnecessarily trigger the full unit test suite (build-test-server,unit-tests,unit-tests-with-test-server) intest.yml, wasting CI resources. The entry was previously needed when integration tests lived intest.ymlbut is now dead weight after the move to the dedicated workflow.Additional Locations (1)
.github/workflows/test.yml#L366-L376