Skip to content

Commit bcd0c4d

Browse files
committed
chore: Add flutter cross platform integration test
1 parent 3acb318 commit bcd0c4d

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

.github/workflows/test-cross-platform.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,83 @@ jobs:
127127
if: failure()
128128
run: ./sentry-cocoa/scripts/ci-diagnostics.sh
129129

130+
test-flutter:
131+
name: Flutter Installation
132+
# Run the job only for PRs with related changes or non-PR events.
133+
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_test_cross_platform_for_prs == 'true'
134+
needs: files-changed
135+
runs-on: ["ghcr.io/cirruslabs/macos-runner:sequoia", "runner_group_id:10"]
136+
# This job can take a while to run, so we set a timeout.
137+
timeout-minutes: 30
138+
steps:
139+
- uses: actions/checkout@v6
140+
with:
141+
repository: getsentry/sentry-cocoa
142+
path: sentry-cocoa
143+
144+
- name: Initialize tools
145+
run: make init-ci-build
146+
working-directory: sentry-cocoa
147+
148+
- name: Clone Sentry Flutter Repository
149+
uses: actions/checkout@v6
150+
with:
151+
repository: getsentry/sentry-dart
152+
path: sentry-dart
153+
ref: main
154+
155+
- name: Ensure required runtime is loaded
156+
# Ideally we will not need this, but CI sometimes is failing to load some runtimes, this will ensure they are loaded
157+
timeout-minutes: 5 # 5 minutes timeout
158+
env:
159+
OS_VERSION: "18.4"
160+
run: ./sentry-cocoa/scripts/ci-ensure-runtime-loaded.sh --os-version "$OS_VERSION"
161+
162+
- name: Remove Sentry/HybridSDK Dependency from sentry-dart/packages/flutter/ios/sentry_flutter.podspec
163+
run: sed -i '' "s/s.dependency 'Sentry\/HybridSDK', '[0-9]*\.[0-9]*\.[0-9]*'/s.dependency 'Sentry\/HybridSDK'/" sentry-dart/packages/flutter/ios/sentry_flutter.podspec
164+
165+
- name: Add Sentry/HybridSDK Dependency to RNSentryCocoaTester/Podfile
166+
run: sed -i '' -e "s/use_modular_headers\!/use_modular_headers\!\n pod 'Sentry\/HybridSDK', :path => '..\/..\/..\/sentry-cocoa'/" sentry-dart/min_version_test/ios/Podfile
167+
168+
# Steps cloned from https://github.com/getsentry/sentry-dart/blob/main/.github/workflows/min_version_test.yml
169+
- uses: subosito/[email protected]
170+
with:
171+
flutter-version: "3.24.0"
172+
173+
- name: Get dependencies
174+
working-directory: sentry-dart/min_version_test
175+
run: flutter pub get
176+
177+
- name: Change ruby to 3.3.10
178+
# We use the same ruby version used by Cirrus to install fastlane and other tools
179+
# see: https://github.com/cirruslabs/macos-image-templates/blob/9115ef25530497999073cdf0f5497a4d142e3256/templates/xcode.pkr.hcl#L235
180+
working-directory: sentry-dart/min_version_test
181+
run: |
182+
rbenv global 3.3.10
183+
184+
- name: Install cocoapods
185+
working-directory: sentry-dart/min_version_test/ios
186+
run: gem install cocoapods
187+
188+
- name: Install App Pods
189+
working-directory: sentry-dart/min_version_test/ios
190+
run: pod install
191+
192+
- name: Build iOS
193+
working-directory: sentry-dart/min_version_test
194+
run: |
195+
flutter build ios --no-codesign
196+
197+
- name: Run CI Diagnostics
198+
if: failure()
199+
run: ./sentry-cocoa/scripts/ci-diagnostics.sh
200+
130201
test_cross_platform-required-check:
131202
needs:
132203
[
133204
files-changed,
134205
test-react-native,
206+
test-flutter,
135207
]
136208
name: Test Cross Platform
137209
# This is necessary since a failed/skipped dependent job would cause this job to be skipped

0 commit comments

Comments
 (0)