-
Notifications
You must be signed in to change notification settings - Fork 13
93 lines (77 loc) · 2.68 KB
/
on-commit.yml
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: On Commit
on:
push:
branches: [ master ]
workflow_dispatch:
env:
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
SLACK_ICON: https://icons.iconarchive.com/icons/martz90/circle/256/android-icon.png
SLACK_TITLE: Commit status
SLACK_USERNAME: Emarsys SDK - Flutter
SLACK_WEBHOOK: ${{ secrets.SLACK_MOBILE_TEAM_CI_CHANNEL_WEBHOOK }}
jobs:
Android:
needs: [Lint]
runs-on: macos-12
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 17
- name: Setup flutter env
uses: subosito/[email protected]
with:
flutter-version: "3.16.7"
architecture: x64
channel: "stable"
- name: Update dependencies
run: flutter pub get
- name: Install Google Services JSON
uses: davidSchuppa/base64Secret-toFile-action@v1
with:
secret: ${{ secrets.GOOGLE_SERVICE_JSON_BASE64 }}
filename: google-services.json
destination-path: ./example/android/app/
- name: Run Android unit tests with gradle
run: (cd example/android && ./gradlew clean build test -x lint)
IOS:
runs-on: macos-12
needs: [Lint]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup flutter env
uses: subosito/[email protected]
with:
flutter-version: "3.16.7"
architecture: x64
channel: "stable"
- name: Open simulator
run: open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/
- name: Update dependencies
run: flutter pub get
- name: Remove old directories
run: rm -rf ~/tmp | rm -rf ~/Library/MobileDevice
shell: bash
- name: Install Dependencies
run: (cd example/ios && pod install --no-repo-update --verbose)
shell: bash
- name: Run Flutter Tests
run: flutter test
- name: Run iOS unit tests
run: xcodebuild -workspace ~/work/flutter-plugin-for-sap-emarsys-customer-engagement/flutter-plugin-for-sap-emarsys-customer-engagement/example/ios/Runner.xcworkspace -scheme RunnerTests -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 13 Pro Max,OS=16.2' test
Lint:
runs-on: macos-12
steps:
- name: Setup flutter env
uses: subosito/[email protected]
with:
flutter-version: "3.16.7"
architecture: x64
channel: "stable"
- name: Flutter lint
run: dart analyze
shell: bash