@@ -12,6 +12,7 @@ concurrency:
1212
1313jobs :
1414 changes :
15+ name : ' Detect changes'
1516 runs-on : ubuntu-latest
1617 # Required permissions
1718 permissions :
@@ -45,40 +46,33 @@ jobs:
4546 - '*.yaml'
4647 windows:
4748 - 'windows/**'
48-
49- android-linux-build :
50- name : ' Android / Linux Build '
49+
50+ flutter-test :
51+ name : ' Flutter Analyze + Test '
5152 needs : changes
52- if : ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.yaml == 'true' }}
53+ if : ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.yaml == 'true' || needs.changes.outputs. android == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.windows == 'true' }}
5354 runs-on : ubuntu-latest
5455 steps :
5556 - name : Checkout
56- uses : actions/checkout@v3
57+ uses : actions/checkout@v4.1.1
5758 - name : Setup Java JDK
58- uses : actions/setup-java@v3
59+ uses : actions/setup-java@v4.2.1
5960 with :
6061 distribution : temurin
6162 java-version : ' 17'
6263 - name : Flutter action
63- uses : subosito/flutter-action@v2.8 .0
64+ uses : subosito/flutter-action@v2.16 .0
6465 with :
6566 channel : stable
67+ cache : true
68+ cache-key : " flutter-:os:-:channel:-:version:-:arch:-:hash:"
69+ cache-path : " ${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
70+ pub-cache-key : " flutter-pub-:os:-:channel:-:version:-:arch:-:hash:"
71+ pub-cache-path : " ${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
6672 - name : Flutter version
6773 run : flutter --version
68- - name : Cache pubspec dependencies
69- uses : actions/cache@v3.0.7
70- with :
71- path : |
72- ${{ env.FLUTTER_HOME }}/.pub-cache
73- **/.packages
74- **/.flutter-plugins
75- **/.flutter-plugin-dependencies
76- **/.dart_tool/package_config.json
77- key : build-pubspec-${{ hashFiles('**/pubspec.lock') }}
78- restore-keys : |
79- build-pubspec-
8074 - name : Cache build runner
81- uses : actions/cache@v2
75+ uses : actions/cache@v4.0.2
8276 with :
8377 path : |
8478 **/.dart_tool
@@ -87,17 +81,59 @@ jobs:
8781 **/*.config.dart
8882 key : build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }}
8983 restore-keys : |
84+ build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }}
9085 build-runner-
9186 - name : Download pub dependencies
9287 run : flutter pub get
9388 - name : Upgrade pub dependencies
9489 run : flutter pub upgrade
9590 - name : Run build_runner
96- run : flutter pub run build_runner build --delete-conflicting-outputs
91+ run : flutter pub run build_runner build
9792 - name : Run analyzer
9893 run : flutter analyze
9994 - name : Run tests
10095 run : flutter test
96+
97+ android-linux-build :
98+ name : ' Build Android + Linux'
99+ needs : [changes, flutter-test]
100+ if : ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.yaml == 'true' }}
101+ runs-on : ubuntu-latest
102+ steps :
103+ - name : Checkout
104+ uses : actions/checkout@v4.1.1
105+ - name : Setup Java JDK
106+ uses : actions/setup-java@v4.2.1
107+ with :
108+ distribution : temurin
109+ java-version : ' 17'
110+ - name : Flutter action
111+ uses : subosito/flutter-action@v2.16.0
112+ with :
113+ channel : stable
114+ cache : true
115+ cache-key : " flutter-:os:-:channel:-:version:-:arch:-:hash:"
116+ cache-path : " ${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
117+ pub-cache-key : " flutter-pub-:os:-:channel:-:version:-:arch:-:hash:"
118+ pub-cache-path : " ${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
119+ - name : Cache build runner
120+ uses : actions/cache@v4.0.2
121+ with :
122+ path : |
123+ **/.dart_tool
124+ **/*.g.dart
125+ **/*.mocks.dart
126+ **/*.config.dart
127+ key : build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }}
128+ restore-keys : |
129+ build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }}
130+ build-runner-
131+ - name : Download pub dependencies
132+ run : flutter pub get
133+ - name : Upgrade pub dependencies
134+ run : flutter pub upgrade
135+ - name : Run build_runner
136+ run : flutter pub run build_runner build
101137 - name : Build Android
102138 if : ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.yaml == 'true' }}
103139 run : |
@@ -112,36 +148,24 @@ jobs:
112148 run : flutter build linux
113149
114150 macos-build :
115- name : ' Macos Build'
116- needs : changes
151+ name : ' Build Macos '
152+ needs : [ changes, flutter-test]
117153 if : ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.yaml == 'true' }}
118154 runs-on : macos-latest
119155 steps :
120156 - name : Checkout
121- uses : actions/checkout@v3
122-
157+ uses : actions/checkout@v4.1.1
123158 - name : Flutter action
124- uses : subosito/flutter-action@v2.8 .0
159+ uses : subosito/flutter-action@v2.16 .0
125160 with :
126161 channel : stable
127-
128- - name : Flutter version
129- run : flutter --version
130-
131- - name : Cache pubspec dependencies
132- uses : actions/cache@v3.0.7
133- with :
134- path : |
135- ${{ env.FLUTTER_HOME }}/.pub-cache
136- **/.packages
137- **/.flutter-plugins
138- **/.flutter-plugin-dependencies
139- **/.dart_tool/package_config.json
140- key : build-pubspec-${{ hashFiles('**/pubspec.lock') }}
141- restore-keys : |
142- build-pubspec-
162+ cache : true
163+ cache-key : " flutter-:os:-:channel:-:version:-:arch:-:hash:"
164+ cache-path : " ${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
165+ pub-cache-key : " flutter-pub-:os:-:channel:-:version:-:arch:-:hash:"
166+ pub-cache-path : " ${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
143167 - name : Cache build runner
144- uses : actions/cache@v2
168+ uses : actions/cache@v4.0.2
145169 with :
146170 path : |
147171 **/.dart_tool
@@ -150,54 +174,59 @@ jobs:
150174 **/*.config.dart
151175 key : build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }}
152176 restore-keys : |
177+ build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }}
153178 build-runner-
154-
179+ - name : Cache pods
180+ uses : actions/cache@v3
181+ with :
182+ path : macos/Pods
183+ key : ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
184+ restore-keys : |
185+ ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
186+ ${{ runner.os }}-pods-
155187 - name : Download pub dependencies
156188 run : flutter pub get
157-
158189 - name : Upgrade pub dependencies
159190 run : flutter pub upgrade
160-
161191 - name : Run build_runner
162- run : flutter pub run build_runner build --delete-conflicting-outputs
163-
164- - name : Run analyzer
165- run : flutter analyze
166-
167- - name : Run tests
168- run : flutter test
169-
192+ run : flutter pub run build_runner build
170193 - name : Build macos
171194 run : flutter build macos
172195
173196 windows-build :
174- name : ' Windows Build'
175- needs : changes
197+ name : ' Build Windows '
198+ needs : [ changes, flutter-test]
176199 if : ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.windows == 'true' || needs.changes.outputs.yaml == 'true' }}
177200 runs-on : windows-latest
178201 steps :
179202 - name : Checkout
180- uses : actions/checkout@v3
181-
203+ uses : actions/checkout@v4.1.1
182204 - name : Flutter action
183- uses : subosito/flutter-action@v2.8 .0
205+ uses : subosito/flutter-action@v2.16 .0
184206 with :
185207 channel : stable
186-
208+ cache : true
209+ cache-key : " flutter-:os:-:channel:-:version:-:arch:-:hash:"
210+ cache-path : " ${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
211+ pub-cache-key : " flutter-pub-:os:-:channel:-:version:-:arch:-:hash:"
212+ pub-cache-path : " ${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
213+ - name : Cache build runner
214+ uses : actions/cache@v4.0.2
215+ with :
216+ path : |
217+ **/.dart_tool
218+ **/*.g.dart
219+ **/*.mocks.dart
220+ **/*.config.dart
221+ key : build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }}
222+ restore-keys : |
223+ build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }}
224+ build-runner-
187225 - name : Download pub dependencies
188226 run : flutter pub get
189-
190227 - name : Upgrade pub dependencies
191228 run : flutter pub upgrade
192-
193229 - name : Run build_runner
194- run : flutter pub run build_runner build --delete-conflicting-outputs
195-
196- - name : Run analyzer
197- run : flutter analyze
198-
199- - name : Run tests
200- run : flutter test
201-
230+ run : flutter pub run build_runner build
202231 - name : Build windows
203232 run : flutter build windows
0 commit comments