Skip to content

Commit 03fc2a6

Browse files
authored
ci: macos integration test (#1645)
1 parent 3e4b523 commit 03fc2a6

File tree

2 files changed

+34
-25
lines changed

2 files changed

+34
-25
lines changed

.github/workflows/flutter.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
access_token: ${{ github.token }}
2222

2323
build:
24-
name: ${{ matrix.target }} | ${{ matrix.os }} | ${{ matrix.sdk }}
24+
name: "${{ matrix.target }} | ${{ matrix.os }} | ${{ matrix.sdk }}"
2525
runs-on: ${{ matrix.os }}
2626
timeout-minutes: 30
2727
defaults:

.github/workflows/flutter_test.yml

+33-24
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- release/**
77
pull_request:
88
paths-ignore:
9-
- 'file/**'
9+
- "file/**"
1010

1111
env:
1212
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
@@ -103,9 +103,10 @@ jobs:
103103
avd-name: macOS-avd-x86_64-31
104104
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
105105
disable-animations: true
106-
script: flutter test integration_test/integration_test.dart --verbose
106+
script: flutter test integration_test --verbose
107107

108-
test-ios:
108+
cocoa:
109+
name: "${{ matrix.target }} | ${{ matrix.sdk }}"
109110
runs-on: macos-13
110111
timeout-minutes: 30
111112
defaults:
@@ -114,8 +115,8 @@ jobs:
114115
strategy:
115116
fail-fast: false
116117
matrix:
117-
# 'beta' is flaky because of https://github.com/flutter/flutter/issues/124340
118-
sdk: ["stable"]
118+
sdk: ["stable", "beta"]
119+
target: ["ios", "macos"]
119120
steps:
120121
- name: checkout
121122
uses: actions/checkout@v3
@@ -131,25 +132,33 @@ jobs:
131132
run: flutter pub get
132133

133134
- name: pod install
134-
working-directory: ./flutter/example/ios
135+
working-directory: ./flutter/example/${{ matrix.target }}
135136
run: pod install
136137

137-
- name: launch ios simulator
138-
id: sim
138+
- name: prepare test device
139+
id: device
139140
run: |
140-
simulator_id=$(xcrun simctl create sentryPhone com.apple.CoreSimulator.SimDeviceType.iPhone-14 com.apple.CoreSimulator.SimRuntime.iOS-16-4)
141-
echo "SIMULATOR_ID=${simulator_id}" >> "$GITHUB_OUTPUT"
142-
xcrun simctl boot ${simulator_id}
143-
# Disable flutter integration tests because of flaky execution
144-
# - name: run ios integration test
145-
# env:
146-
# SIMULATOR_ID: ${{ steps.sim.outputs.SIMULATOR_ID }}
147-
# run: flutter test -d "$SIMULATOR_ID" integration_test/integration_test.dart --verbose
148-
149-
- name: run ios native test
150-
working-directory: ./flutter/example/ios
151-
env:
152-
SIMULATOR_ID: ${{ steps.sim.outputs.SIMULATOR_ID }}
153-
run: xcodebuild test -workspace Runner.xcworkspace -scheme Runner -configuration Debug -destination "platform=iOS Simulator,id=$SIMULATOR_ID" -allowProvisioningUpdates CODE_SIGNING_ALLOWED=NO
154-
155-
141+
case "${{ matrix.target }}" in
142+
ios)
143+
device=$(xcrun simctl create sentryPhone com.apple.CoreSimulator.SimDeviceType.iPhone-14 com.apple.CoreSimulator.SimRuntime.iOS-16-4)
144+
xcrun simctl boot ${device}
145+
echo "platform=iOS Simulator,id=${device}" >> "$GITHUB_OUTPUT"
146+
;;
147+
macos)
148+
device="macos"
149+
echo "platform=OS X" >> "$GITHUB_OUTPUT"
150+
;;
151+
esac
152+
echo "name=${device}" >> "$GITHUB_OUTPUT"
153+
154+
- name: run integration test
155+
# Disable flutter integration tests for iOS for now (https://github.com/getsentry/sentry-dart/issues/1605#issuecomment-1695809346)
156+
if: ${{ matrix.target != 'ios' }}
157+
run: flutter test -d "${{ steps.device.outputs.name }}" integration_test --verbose
158+
159+
- name: run native test
160+
# We only have the native unit test package in the iOS xcodeproj at the moment.
161+
# Should be OK because it will likely be removed after switching to FFI (see https://github.com/getsentry/sentry-dart/issues/1444).
162+
if: ${{ matrix.target != 'macos' }}
163+
working-directory: ./flutter/example/${{ matrix.target }}
164+
run: xcodebuild test -workspace Runner.xcworkspace -scheme Runner -configuration Debug -destination "platform=${{ steps.device.outputs.platform }}" -allowProvisioningUpdates CODE_SIGNING_ALLOWED=NO

0 commit comments

Comments
 (0)