-
Notifications
You must be signed in to change notification settings - Fork 45
224 lines (177 loc) · 7.13 KB
/
ci.yaml
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
name: CI
on:
push:
pull_request:
schedule:
- cron: "0 10 * * *"
permissions:
contents: write
jobs:
flutter:
name: ${{ matrix.package_name_and_runs_on.package_name }} on Flutter ${{ matrix.channel_version.channel }}
runs-on: ${{ matrix.package_name_and_runs_on.runs_on }}
strategy:
fail-fast: false
matrix:
package_name_and_runs_on:
- {package_name: convenient_test, runs_on: ubuntu-latest}
- {package_name: convenient_test/example, runs_on: ubuntu-latest}
- {package_name: convenient_test_common, runs_on: ubuntu-latest}
- {package_name: convenient_test_common_dart, runs_on: ubuntu-latest}
- {package_name: convenient_test_dev, runs_on: ubuntu-latest}
# NOTE run `convenient_test_manager` on macos for its goldens
- {package_name: convenient_test_manager, runs_on: macos-latest}
- {package_name: convenient_test_manager_dart, runs_on: ubuntu-latest}
channel_version:
- { channel: stable }
# - { channel: beta }
# see https://github.com/fzyzcjy/flutter_convenient_test/pull/319#issuecomment-1445048397
steps:
- uses: actions/checkout@v4
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: ${{ matrix.channel_version.channel }}
# flutter-version: ${{ matrix.channel_version.version }}
- name: Install dependencies
run: flutter pub get
working-directory: packages/${{ matrix.package_name_and_runs_on.package_name }}
- name: Analyze
run: flutter analyze
working-directory: packages/${{ matrix.package_name_and_runs_on.package_name }}
- name: Run tests
run: flutter test
working-directory: packages/${{ matrix.package_name_and_runs_on.package_name }}
- name: Check format
run: dart format --set-exit-if-changed .
working-directory: packages/${{ matrix.package_name_and_runs_on.package_name }}
build_manager_macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: stable
- name: Enable Macos
run: flutter config --enable-macos-desktop
- name: Install dependencies
run: flutter pub get
working-directory: packages/convenient_test_manager
- uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7.8"
bundler-cache: true
- name: setup-cocoapods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: latest
- name: flutter build
run: flutter build macos
working-directory: packages/convenient_test_manager/macos
- name: build_mac_app
run: bundle install && bundle exec fastlane run build_mac_app export_method:mac-application scheme:Runner output_directory:./build
working-directory: packages/convenient_test_manager/macos
- name: Tar outputs
run: tar cvf manager_gui_macos.zip convenient_test_manager.app
working-directory: packages/convenient_test_manager/macos/build
- uses: actions/upload-artifact@v4
with:
name: manager_gui_macos.zip
path: packages/convenient_test_manager/macos/build/manager_gui_macos.zip
- name: Add to release if tagged
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: packages/convenient_test_manager/macos/build/manager_gui_macos.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_manager_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: stable
- name: Enable Linux
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libvlc-dev vlc
flutter config --enable-linux-desktop
working-directory: packages/convenient_test_manager
- name: Install dependencies
run: flutter pub get
working-directory: packages/convenient_test_manager
- name: flutter build
run: flutter build linux
working-directory: packages/convenient_test_manager
- name: Tar outputs
run: tar -czvf manager_gui_linux.tar.gz bundle
working-directory: packages/convenient_test_manager/build/linux/x64/release
- uses: actions/upload-artifact@v4
with:
name: manager_gui_linux.tar.gz
path: packages/convenient_test_manager/build/linux/x64/release/manager_gui_linux.tar.gz
- name: Add to release if tagged
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: packages/convenient_test_manager/build/linux/x64/release/manager_gui_linux.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_manager_dart_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install dependencies
run: flutter pub get
working-directory: packages/convenient_test_manager_dart
- name: Build
run: dart compile exe bin/convenient_test_manager_dart.dart -o manager_cli_linux
working-directory: packages/convenient_test_manager_dart
- uses: actions/upload-artifact@v4
with:
name: manager_cli_linux
path: packages/convenient_test_manager_dart/manager_cli_linux
- name: Add to release if tagged
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: packages/convenient_test_manager_dart/manager_cli_linux
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_manager_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: stable
- name: Enable windows build
run: flutter config --enable-windows-desktop
working-directory: packages/convenient_test_manager
- name: Install project dependencies
run: flutter pub get
working-directory: packages/convenient_test_manager
- name: Build artifacts
run: flutter build windows --release
working-directory: packages/convenient_test_manager
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
type: zip
filename: manager_gui_windows.zip
directory: packages/convenient_test_manager/build/windows/x64/runner/Release
- uses: actions/upload-artifact@v4
with:
name: manager_gui_windows.zip
path: packages/convenient_test_manager/build/windows/x64/runner/Release/manager_gui_windows.zip
- name: Add to release if tagged
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: packages/convenient_test_manager/build/windows/x64/runner/Release/manager_gui_windows.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}