-
Notifications
You must be signed in to change notification settings - Fork 22
141 lines (139 loc) · 4.08 KB
/
on-pull-request.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Test & Build
on:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
analyze:
runs-on: ubuntu-latest
name: Analyze
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
cache: true
- name: Install melos
run: dart pub global activate melos
- name: Bootstrap melos
run: melos bootstrap
- name: Get dependencies
run: melos run pub_get --no-select
- name: Analyze all projects
run: dart analyze --fatal-infos --fatal-warnings
- name: Format all projects
run: dart format --output=none --set-exit-if-changed .
test:
runs-on: ubuntu-latest
name: Test
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
cache: true
- name: Install melos
run: dart pub global activate melos
- name: Bootstrap melos
run: melos bootstrap
- name: Install coverde
run: dart pub global activate coverde
- name: Run tests with coverage
run: melos run test_with_coverage --no-select
- name: Run Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
package-score:
name: "Package score"
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
cache: true
- name: Install melos
run: dart pub global activate melos
- name: Bootstrap melos
run: melos bootstrap
- name: Install pana
run: dart pub global activate pana
- name: Check package score for all
run: melos run package_score --no-select
build-android:
runs-on: ubuntu-latest
name: Build Android
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
cache: true
- name: Build APK
working-directory: example
run: flutter build apk
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: apk
path: example/build/app/outputs/flutter-apk/app-release.apk
- name: Upload apk as artifact
uses: actions/upload-artifact@v4
with:
name: flutter_map_plugins_example.apk
path: example/build/app/outputs/flutter-apk/app-release.apk
# build-ios:
# runs-on: macos-latest
# name: Build iOS
# defaults:
# run:
# working-directory: ./example
# steps:
# - uses: actions/checkout@v4
# - uses: subosito/flutter-action@v2
# with:
# flutter-version: ${{ matrix.sdk }}
# 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@v4
# with:
# name: flutter_map_plugins_example.app
# path: example/build/ios/iphonesimulator
build-web:
runs-on: ubuntu-latest
name: Build Web
defaults:
run:
working-directory: ./example
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
cache: true
- name: Build Web
run: flutter build web
- name: Upload web as artifact
uses: actions/upload-artifact@v4
with:
name: flutter_map_plugins_example.web
path: example/build/web