-
Notifications
You must be signed in to change notification settings - Fork 45
158 lines (133 loc) · 5.22 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
name: CI
on:
push:
pull_request:
schedule:
- cron: "0 10 * * *"
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@v3
- 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: Dart code metrics
run: flutter pub run dart_code_metrics:metrics analyze lib --fatal-style --fatal-performance --fatal-warnings --set-exit-on-violation-level noted
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 --line-length 120 .
working-directory: packages/${{ matrix.package_name_and_runs_on.package_name }}
# TODO fix it (seems GitHub Actions upgraded, making Fastlane confused)
# build_manager_macos:
# runs-on: macos-11
#
# steps:
# - uses: actions/checkout@v3
#
# - 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.0"
# 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: cd packages/convenient_test_manager/macos/build && tar cvf convenient_test_manager.app.tar convenient_test_manager.app
#
# - uses: actions/upload-artifact@v3
# with:
# name: manager_macos
# path: packages/convenient_test_manager/macos/build/convenient_test_manager.app.tar
build_manager_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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 convenient_test_manager.tar.gz -C packages/convenient_test_manager/build/linux/x64/release/ bundle
- uses: actions/upload-artifact@v3
with:
name: manager_linux
path: convenient_test_manager.tar.gz
build_manager_dart_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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 convenient_test_manager_dart
working-directory: packages/convenient_test_manager_dart
- uses: actions/upload-artifact@v3
with:
name: manager_dart_linux
path: packages/convenient_test_manager_dart/convenient_test_manager_dart