|
1 |
| -name: flutter integration tests |
| 1 | +name: flutter native & integration test |
2 | 2 | on:
|
3 |
| - # Currently broken, enable after fixing |
4 |
| - workflow_dispatch |
5 |
| - # push: |
6 |
| - # branches: |
7 |
| - # - main |
8 |
| - # - release/** |
9 |
| - # pull_request: |
10 |
| - # paths-ignore: |
11 |
| - # - 'file/**' |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + - release/** |
| 7 | + pull_request: |
| 8 | + paths-ignore: |
| 9 | + - 'file/**' |
| 10 | + |
| 11 | +env: |
| 12 | + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} |
12 | 13 |
|
13 | 14 | jobs:
|
14 | 15 | cancel-previous-workflow:
|
|
73 | 74 | profile: Nexus 6
|
74 | 75 | script: echo 'Generated AVD snapshot for caching.'
|
75 | 76 |
|
| 77 | + - name: build apk |
| 78 | + working-directory: ./flutter/example/android |
| 79 | + run: flutter build apk --debug |
| 80 | + |
| 81 | + - name: launch android emulator & run android native test |
| 82 | + uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b #[email protected] |
| 83 | + with: |
| 84 | + working-directory: ./flutter/example/android |
| 85 | + api-level: 21 |
| 86 | + force-avd-creation: false |
| 87 | + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none |
| 88 | + disable-animations: true |
| 89 | + arch: x86_64 |
| 90 | + profile: Nexus 6 |
| 91 | + script: ./gradlew testDebugUnitTest |
| 92 | + |
76 | 93 | - name: launch android emulator & run android integration test
|
77 | 94 | uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b #[email protected]
|
78 | 95 | with:
|
@@ -110,10 +127,26 @@ jobs:
|
110 | 127 | - name: flutter pub get
|
111 | 128 | run: flutter pub get
|
112 | 129 |
|
| 130 | + - name: pod install |
| 131 | + working-directory: ./flutter/example/ios |
| 132 | + run: pod install |
| 133 | + |
113 | 134 | - name: launch ios simulator
|
| 135 | + id: sim |
114 | 136 | run: |
|
115 | 137 | simulator_id=$(xcrun simctl create sentryPhone com.apple.CoreSimulator.SimDeviceType.iPhone-14 com.apple.CoreSimulator.SimRuntime.iOS-16-2)
|
| 138 | + echo "SIMULATOR_ID=${simulator_id}" >> "$GITHUB_OUTPUT" |
116 | 139 | xcrun simctl boot ${simulator_id}
|
| 140 | +# Disable flutter integration tests because of flaky execution |
| 141 | +# - name: run ios integration test |
| 142 | +# env: |
| 143 | +# SIMULATOR_ID: ${{ steps.sim.outputs.SIMULATOR_ID }} |
| 144 | +# run: flutter test -d "$SIMULATOR_ID" integration_test/integration_test.dart --verbose |
| 145 | + |
| 146 | + - name: run ios native test |
| 147 | + working-directory: ./flutter/example/ios |
| 148 | + env: |
| 149 | + SIMULATOR_ID: ${{ steps.sim.outputs.SIMULATOR_ID }} |
| 150 | + run: xcodebuild test -workspace Runner.xcworkspace -scheme Runner -configuration Debug -destination "platform=iOS Simulator,id=$SIMULATOR_ID" -allowProvisioningUpdates CODE_SIGNING_ALLOWED=NO |
| 151 | + |
117 | 152 |
|
118 |
| - - name: run ios integration test |
119 |
| - run: flutter test integration_test/integration_test.dart --verbose |
|
0 commit comments