-
-
Notifications
You must be signed in to change notification settings - Fork 71
173 lines (165 loc) · 5.67 KB
/
main.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: CI/CD
on:
push:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
score-package:
name: "Score Package"
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@master
- name: Run Dart Package Analyser
uses: axel-op/dart-package-analyzer@master
id: analysis
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Check Package Scores
env:
TOTAL: ${{ steps.analysis.outputs.total }}
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
run: |
if (( $TOTAL < $TOTAL_MAX ))
then
echo Package score less than available score. Improve the score!
exit 1
fi
analyse-code:
name: "Analyse Code"
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@master
- name: Setup Flutter Environment
uses: subosito/flutter-action@master
with:
channel: "beta"
- name: Get Package Dependencies
run: flutter pub get
- name: Get Example Dependencies
run: flutter pub get -C example
- name: Get Test Tile Server Dependencies
run: dart pub get -C tile_server
- name: Check Formatting
run: dart format --output=none --set-exit-if-changed .
- name: Check Lints
run: dart analyze --fatal-warnings
run-tests:
name: "Run Tests"
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@master
- name: Setup Flutter Environment
uses: subosito/flutter-action@master
with:
channel: "beta"
- name: Get Dependencies
run: flutter pub get
- name: Run Tests
run: flutter test -r expanded
build-demo-android:
name: "Build Demo App (Android)"
runs-on: ubuntu-latest
needs: [analyse-code, run-tests]
defaults:
run:
working-directory: ./example
steps:
- name: Checkout Repository
uses: actions/checkout@master
- name: Setup Java 17 Environment
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
- name: Setup Flutter Environment
uses: subosito/flutter-action@master
with:
channel: "beta"
- name: Build
run: flutter build apk --obfuscate --split-debug-info=./symbols
- name: Upload Artifact
uses: actions/[email protected]
with:
name: android-demo
path: example/build/app/outputs/apk/release
if-no-files-found: error
build-demo-windows:
name: "Build Demo App (Windows)"
runs-on: windows-latest
needs: [analyse-code, run-tests]
defaults:
run:
working-directory: ./example
steps:
- name: Checkout Repository
uses: actions/checkout@master
- name: Setup Flutter Environment
uses: subosito/flutter-action@master
with:
channel: "beta"
- name: Build
run: flutter build windows --obfuscate --split-debug-info=./symbols
- name: Create Installer
run: iscc "windowsApplicationInstallerSetup.iss"
working-directory: .
- name: Upload Artifact
uses: actions/[email protected]
with:
name: windows-demo
path: windowsTemp/WindowsApplication.exe
if-no-files-found: error
build-tile-server-windows:
name: "Build Tile Server (Windows)"
runs-on: windows-latest
needs: [analyse-code, run-tests]
defaults:
run:
working-directory: ./tile_server
steps:
- name: Checkout Repository
uses: actions/checkout@master
- name: Setup Dart Environment
uses: dart-lang/[email protected]
- name: Get Dependencies
run: dart pub get
- name: Get Dart Dependencies
run: dart pub get
- name: Generate Tile Images
run: dart run bin/generate_dart_images.dart
- name: Compile
run: dart compile exe bin/tile_server.dart
- name: Upload Artifact
uses: actions/[email protected]
with:
name: windows-ts
path: tile_server/bin/tile_server.exe
if-no-files-found: error
build-tile-server-linux:
name: "Build Tile Server (Linux/Ubuntu)"
runs-on: ubuntu-latest
needs: [analyse-code, run-tests]
defaults:
run:
working-directory: ./tile_server
steps:
- name: Checkout Repository
uses: actions/checkout@master
- name: Setup Dart Environment
uses: dart-lang/[email protected]
- name: Get Dependencies
run: dart pub get
- name: Run Pre-Compile Generator
run: dart run bin/generate_dart_images.dart
- name: Compile
run: dart compile exe bin/tile_server.dart
- name: Upload Artifact
uses: actions/[email protected]
with:
name: linux-ts
path: tile_server/bin/tile_server.exe
if-no-files-found: error