forked from maplibre/flutter-maplibre-gl
-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (102 loc) · 2.97 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
name: Flutter CI
on: [push, pull_request, workflow_dispatch]
env:
FLUTTER_CHANNEL: 'stable'
FLUTTER_VERSION: '3.10.5'
jobs:
format:
name: "Check formatting"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2.10.0
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
cache: true
- name: Lint analysis
run: dart format --set-exit-if-changed .
lint:
name: "Static code analysis"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2.10.0
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
cache: true
- run: flutter pub get
- run: |
cd scripts
flutter pub get
cd ..
- name: Lint analysis
run: flutter analyze
build-android:
name: "Build Android apk"
runs-on: ubuntu-latest
defaults:
run:
working-directory: example
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'gradle'
- uses: subosito/flutter-action@v2.10.0
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
cache: true
- run: flutter pub get
- name: Build example APK
run: flutter build apk
- name: Upload apk as artifact
uses: actions/upload-artifact@v3
with:
name: maplibre.apk
path: example/build/app/outputs/flutter-apk/app-release.apk
# We might want to add a flutter test step in the future, when there actually are tests for this plugin
build-iOS:
name: Build iOS package
runs-on: macos-latest
defaults:
run:
working-directory: example
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2.10.0
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
cache: true
- uses: maxim-lobanov/setup-cocoapods@v1
with:
podfile-path: example/ios/Podfile.lock
- run: flutter pub get
- name: Build iOS package
run: flutter build ios --simulator
- name: Upload Runner.app as artifact
uses: actions/upload-artifact@v3
with:
name: Runner.app
path: example/build/ios/iphonesimulator
build-web:
name: "Build web"
runs-on: ubuntu-latest
defaults:
run:
working-directory: example
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2.10.0
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
cache: true
- run: flutter pub get
- name: Build web
run: flutter build web