-
Notifications
You must be signed in to change notification settings - Fork 507
117 lines (103 loc) · 3.28 KB
/
flutter_ci.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Flutter CI
on: [pull_request]
jobs:
lint:
name: "Static code analysis"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: "12.x"
- uses: subosito/flutter-action@v1
with:
flutter-version: "2.10.5"
- run: flutter pub get
- name: Lint analysis
run: cd example && flutter analyze
check-dart-formatting:
name: "Check Dart formatting"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: subosito/flutter-action@v1
- name: Check Dart formatting
run: dart format --set-exit-if-changed .
check-swift-formatting:
name: "Check Swift formatting"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: get SwiftFormat
run: ./install_formatting_tools.sh
- name: Check Swift formatting
run: ./swiftformat --swiftversion 4.2 --maxwidth 100 --lint ios
check-java-formatting:
name: "Check Java formatting"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: get google-java-format
run: ./install_formatting_tools.sh
- name: Check Java formatting
run: >
java
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
-jar google-java-format-1.13.0-all-deps.jar --set-exit-if-changed -n $(find . -type f -name "*.java")
build-android:
environment: ANDROID_CI_DOWNLOADS_TOKEN
name: "Build Android apk"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: "12.x"
- uses: subosito/flutter-action@v2
with:
flutter-version: "2.10.5"
- run: flutter pub get
- name: Build example APK
run: cd example && flutter build apk
env:
SDK_REGISTRY_TOKEN: ${{ secrets.SDK_REGISTRY_ANDROID}}
build-iOS:
environment: ANDROID_CI_DOWNLOADS_TOKEN
name: Build iOS package
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: "12.x"
- uses: subosito/flutter-action@v2
with:
flutter-version: "2.10.5"
- run: flutter pub get
- name: build iOS package
run: |
echo "machine api.mapbox.com
login mapbox
password $SDK_REGISTRY_TOKEN" >> ~/.netrc
chmod 600 ~/.netrc
cd ./example
flutter build ios --release --no-codesign
env:
SDK_REGISTRY_TOKEN: ${{ secrets.SDK_REGISTRY_IOS}}
build-web:
name: "Build web"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: "12.x"
- uses: subosito/flutter-action@v1
- run: flutter config --enable-web
- run: flutter pub get
- name: Build web
run: cd example && flutter build web