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
ci: macos integration test
  • Loading branch information
vaind committed Sep 18, 2023
commit 3f66492974ef6337cf49a54cb41d05f435b31b3d
2 changes: 1 addition & 1 deletion .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
access_token: ${{ github.token }}

build:
name: ${{ matrix.target }} | ${{ matrix.os }} | ${{ matrix.sdk }}
name: "${{ matrix.target }} | ${{ matrix.os }} | ${{ matrix.sdk }}"
runs-on: ${{ matrix.os }}
timeout-minutes: 30
defaults:
Expand Down
57 changes: 33 additions & 24 deletions .github/workflows/flutter_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- release/**
pull_request:
paths-ignore:
- 'file/**'
- "file/**"

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

test-ios:
cocoa:
name: "${{ matrix.target }} | ${{ matrix.sdk }}"
runs-on: macos-13
timeout-minutes: 30
defaults:
Expand All @@ -114,8 +115,8 @@ jobs:
strategy:
fail-fast: false
matrix:
# 'beta' is flaky because of https://github.com/flutter/flutter/issues/124340
sdk: ["stable"]
sdk: ["stable", "beta"]
target: ["ios", "macos"]
steps:
- name: checkout
uses: actions/checkout@v3
Expand All @@ -131,25 +132,33 @@ jobs:
run: flutter pub get

- name: pod install
working-directory: ./flutter/example/ios
working-directory: ./flutter/example/${{ matrix.target }}
run: pod install

- name: launch ios simulator
id: sim
- name: prepare test device
id: device
run: |
simulator_id=$(xcrun simctl create sentryPhone com.apple.CoreSimulator.SimDeviceType.iPhone-14 com.apple.CoreSimulator.SimRuntime.iOS-16-4)
echo "SIMULATOR_ID=${simulator_id}" >> "$GITHUB_OUTPUT"
xcrun simctl boot ${simulator_id}
# Disable flutter integration tests because of flaky execution
# - name: run ios integration test
# env:
# SIMULATOR_ID: ${{ steps.sim.outputs.SIMULATOR_ID }}
# run: flutter test -d "$SIMULATOR_ID" integration_test/integration_test.dart --verbose

- name: run ios native test
working-directory: ./flutter/example/ios
env:
SIMULATOR_ID: ${{ steps.sim.outputs.SIMULATOR_ID }}
run: xcodebuild test -workspace Runner.xcworkspace -scheme Runner -configuration Debug -destination "platform=iOS Simulator,id=$SIMULATOR_ID" -allowProvisioningUpdates CODE_SIGNING_ALLOWED=NO


case "${{ matrix.target }}" in
ios)
device=$(xcrun simctl create sentryPhone com.apple.CoreSimulator.SimDeviceType.iPhone-14 com.apple.CoreSimulator.SimRuntime.iOS-16-4)
xcrun simctl boot ${device}
echo "platform=iOS Simulator,id=${device}" >> "$GITHUB_OUTPUT"
;;
macos)
device="macos"
echo "platform=OS X" >> "$GITHUB_OUTPUT"
;;
esac
echo "name=${device}" >> "$GITHUB_OUTPUT"

- name: run integration test
# Disable flutter integration tests for iOS for now (https://github.com/getsentry/sentry-dart/issues/1605#issuecomment-1695809346)
if: ${{ matrix.target != 'ios' }}
run: flutter test -d "${{ steps.device.outputs.name }}" integration_test --verbose

- name: run native test
# We only have the native unit test package in the iOS xcodeproj at the moment.
# Should be OK because it will likely be removed after switching to FFI (see https://github.com/getsentry/sentry-dart/issues/1444).
if: ${{ matrix.target != 'macos' }}
working-directory: ./flutter/example/${{ matrix.target }}
run: xcodebuild test -workspace Runner.xcworkspace -scheme Runner -configuration Debug -destination "platform=${{ steps.device.outputs.platform }}" -allowProvisioningUpdates CODE_SIGNING_ALLOWED=NO