-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (56 loc) · 2.14 KB
/
tests.yml
File metadata and controls
71 lines (56 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Run tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
dart-unit-tests:
name: Dart unit tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Set up Flutter (stable)
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Install package dependencies
run: flutter pub get
- name: Run tests
run: flutter test
native-macos-unit-tests:
name: Native macOS unit tests
runs-on: macos-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Set up Flutter (stable)
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
# To skip installing CocoaPods, ruby and avoid any build failures or compatibility issues.
- name: Enable Flutter Swift Package Manager
run: flutter config --enable-swift-package-manager
- name: Install dependencies
run: flutter pub get
working-directory: example
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
# macOS 14+ requires UI access to open the app for running tests. To work around this, disable macOS sandboxing.
# For more details, see: https://github.com/flutter/packages/pull/6866
- name: Disable macOS sandboxing
run: |
# Replace <true/> with <false/> for DebugProfile.entitlements
/usr/libexec/PlistBuddy -c "Set :com.apple.security.app-sandbox bool false" DebugProfile.entitlements
# Replace <true/> with <false/> for Release.entitlements
/usr/libexec/PlistBuddy -c "Set :com.apple.security.app-sandbox bool false" Release.entitlements
working-directory: example/macos/Runner
# Native macOS tests are in the example app: https://docs.flutter.dev/testing/testing-plugins#native-unit-tests
- name: Run tests
run: xcodebuild test -workspace Runner.xcworkspace -scheme Runner -configuration Debug -quiet
working-directory: example/macos