Skip to content

Commit af8c428

Browse files
authored
Run steps for all packages, even if previous package failed (#297)
...within the same job Fixes #296 Prepare to release v3.4.4
1 parent 12b6a47 commit af8c428

File tree

9 files changed

+86
-28
lines changed

9 files changed

+86
-28
lines changed

.github/workflows/dart.yml

Lines changed: 50 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Created with package:mono_repo v3.4.3
1+
# Created with package:mono_repo v3.4.4
22
name: Dart CI
33
on:
44
push:
@@ -33,9 +33,11 @@ jobs:
3333
with:
3434
release-channel: dev
3535
- run: dart --version
36-
- uses: actions/checkout@v2
36+
- id: checkout
37+
uses: actions/checkout@v2
3738
- id: mono_repo_pub_upgrade
3839
name: "mono_repo; pub upgrade --no-precompile"
40+
if: "always() && steps.checkout.conclusion == 'success'"
3941
working-directory: mono_repo
4042
run: pub upgrade --no-precompile
4143
- name: "mono_repo; cd ../ && dart mono_repo/bin/mono_repo.dart generate --validate"
@@ -60,9 +62,11 @@ jobs:
6062
with:
6163
release-channel: dev
6264
- run: dart --version
63-
- uses: actions/checkout@v2
65+
- id: checkout
66+
uses: actions/checkout@v2
6467
- id: mono_repo_pub_upgrade
6568
name: "mono_repo; pub upgrade --no-precompile"
69+
if: "always() && steps.checkout.conclusion == 'success'"
6670
working-directory: mono_repo
6771
run: pub upgrade --no-precompile
6872
- name: "mono_repo; dartfmt -n --set-exit-if-changed ."
@@ -75,6 +79,7 @@ jobs:
7579
run: dartanalyzer --fatal-infos .
7680
- id: test_pkg_pub_upgrade
7781
name: "test_pkg; pub upgrade --no-precompile"
82+
if: "always() && steps.checkout.conclusion == 'success'"
7883
working-directory: test_pkg
7984
run: pub upgrade --no-precompile
8085
- name: "test_pkg; dartfmt -n --set-exit-if-changed ."
@@ -104,9 +109,11 @@ jobs:
104109
release-channel: stable
105110
version: "2.7.0"
106111
- run: dart --version
107-
- uses: actions/checkout@v2
112+
- id: checkout
113+
uses: actions/checkout@v2
108114
- id: mono_repo_pub_upgrade
109115
name: "mono_repo; pub upgrade --no-precompile"
116+
if: "always() && steps.checkout.conclusion == 'success'"
110117
working-directory: mono_repo
111118
run: pub upgrade --no-precompile
112119
- name: mono_repo; dartanalyzer .
@@ -131,9 +138,11 @@ jobs:
131138
with:
132139
release-channel: edge
133140
- run: dart --version
134-
- uses: actions/checkout@v2
141+
- id: checkout
142+
uses: actions/checkout@v2
135143
- id: test_pkg_pub_upgrade
136144
name: "test_pkg; pub upgrade --no-precompile"
145+
if: "always() && steps.checkout.conclusion == 'success'"
137146
working-directory: test_pkg
138147
run: pub upgrade --no-precompile
139148
- name: "test_pkg; dartfmt -n --set-exit-if-changed ."
@@ -163,9 +172,11 @@ jobs:
163172
release-channel: dev
164173
version: "2.12.0-0.0.dev"
165174
- run: dart --version
166-
- uses: actions/checkout@v2
175+
- id: checkout
176+
uses: actions/checkout@v2
167177
- id: test_pkg_pub_upgrade
168178
name: "test_pkg; pub upgrade --no-precompile"
179+
if: "always() && steps.checkout.conclusion == 'success'"
169180
working-directory: test_pkg
170181
run: pub upgrade --no-precompile
171182
- name: "test_pkg; dartfmt -n --set-exit-if-changed ."
@@ -194,9 +205,11 @@ jobs:
194205
with:
195206
release-channel: beta
196207
- run: dart --version
197-
- uses: actions/checkout@v2
208+
- id: checkout
209+
uses: actions/checkout@v2
198210
- id: test_pkg_pub_upgrade
199211
name: "test_pkg; pub upgrade --no-precompile"
212+
if: "always() && steps.checkout.conclusion == 'success'"
200213
working-directory: test_pkg
201214
run: pub upgrade --no-precompile
202215
- name: "test_pkg; dartfmt -n --set-exit-if-changed ."
@@ -226,9 +239,11 @@ jobs:
226239
release-channel: beta
227240
version: "2.12.0-29.10.beta"
228241
- run: dart --version
229-
- uses: actions/checkout@v2
242+
- id: checkout
243+
uses: actions/checkout@v2
230244
- id: test_pkg_pub_upgrade
231245
name: "test_pkg; pub upgrade --no-precompile"
246+
if: "always() && steps.checkout.conclusion == 'success'"
232247
working-directory: test_pkg
233248
run: pub upgrade --no-precompile
234249
- name: "test_pkg; dartfmt -n --set-exit-if-changed ."
@@ -257,9 +272,11 @@ jobs:
257272
with:
258273
release-channel: stable
259274
- run: dart --version
260-
- uses: actions/checkout@v2
275+
- id: checkout
276+
uses: actions/checkout@v2
261277
- id: test_pkg_pub_upgrade
262278
name: "test_pkg; pub upgrade --no-precompile"
279+
if: "always() && steps.checkout.conclusion == 'success'"
263280
working-directory: test_pkg
264281
run: pub upgrade --no-precompile
265282
- name: "test_pkg; dartfmt -n --set-exit-if-changed ."
@@ -289,9 +306,11 @@ jobs:
289306
release-channel: stable
290307
version: "2.10.4"
291308
- run: dart --version
292-
- uses: actions/checkout@v2
309+
- id: checkout
310+
uses: actions/checkout@v2
293311
- id: test_pkg_pub_upgrade
294312
name: "test_pkg; pub upgrade --no-precompile"
313+
if: "always() && steps.checkout.conclusion == 'success'"
295314
working-directory: test_pkg
296315
run: pub upgrade --no-precompile
297316
- name: "test_pkg; dartfmt -n --set-exit-if-changed ."
@@ -321,9 +340,11 @@ jobs:
321340
release-channel: stable
322341
version: "2.7.0"
323342
- run: dart --version
324-
- uses: actions/checkout@v2
343+
- id: checkout
344+
uses: actions/checkout@v2
325345
- id: mono_repo_pub_upgrade
326346
name: "mono_repo; pub upgrade --no-precompile"
347+
if: "always() && steps.checkout.conclusion == 'success'"
327348
working-directory: mono_repo
328349
run: pub upgrade --no-precompile
329350
- name: "mono_repo; pub run test -x yaml -P presubmit --test-randomize-ordering-seed=random"
@@ -349,9 +370,11 @@ jobs:
349370
release-channel: stable
350371
version: "2.7.0"
351372
- run: dart --version
352-
- uses: actions/checkout@v2
373+
- id: checkout
374+
uses: actions/checkout@v2
353375
- id: mono_repo_pub_upgrade
354376
name: "mono_repo; pub.bat upgrade --no-precompile"
377+
if: "always() && steps.checkout.conclusion == 'success'"
355378
working-directory: mono_repo
356379
run: pub.bat upgrade --no-precompile
357380
- name: "mono_repo; pub run test -x yaml -P presubmit --test-randomize-ordering-seed=random"
@@ -386,9 +409,11 @@ jobs:
386409
with:
387410
release-channel: dev
388411
- run: dart --version
389-
- uses: actions/checkout@v2
412+
- id: checkout
413+
uses: actions/checkout@v2
390414
- id: mono_repo_pub_upgrade
391415
name: "mono_repo; pub upgrade --no-precompile"
416+
if: "always() && steps.checkout.conclusion == 'success'"
392417
working-directory: mono_repo
393418
run: pub upgrade --no-precompile
394419
- name: "mono_repo; pub run test -x yaml -P presubmit --test-randomize-ordering-seed=random"
@@ -413,9 +438,11 @@ jobs:
413438
with:
414439
release-channel: dev
415440
- run: dart --version
416-
- uses: actions/checkout@v2
441+
- id: checkout
442+
uses: actions/checkout@v2
417443
- id: mono_repo_pub_upgrade
418444
name: "mono_repo; pub.bat upgrade --no-precompile"
445+
if: "always() && steps.checkout.conclusion == 'success'"
419446
working-directory: mono_repo
420447
run: pub.bat upgrade --no-precompile
421448
- name: "mono_repo; pub run test -x yaml -P presubmit --test-randomize-ordering-seed=random"
@@ -451,9 +478,11 @@ jobs:
451478
release-channel: stable
452479
version: "2.7.0"
453480
- run: dart --version
454-
- uses: actions/checkout@v2
481+
- id: checkout
482+
uses: actions/checkout@v2
455483
- id: mono_repo_pub_upgrade
456484
name: "mono_repo; pub upgrade --no-precompile"
485+
if: "always() && steps.checkout.conclusion == 'success'"
457486
working-directory: mono_repo
458487
run: pub upgrade --no-precompile
459488
- name: "mono_repo; pub run test -t yaml --test-randomize-ordering-seed=random"
@@ -488,9 +517,11 @@ jobs:
488517
with:
489518
release-channel: dev
490519
- run: dart --version
491-
- uses: actions/checkout@v2
520+
- id: checkout
521+
uses: actions/checkout@v2
492522
- id: mono_repo_pub_upgrade
493523
name: "mono_repo; pub upgrade --no-precompile"
524+
if: "always() && steps.checkout.conclusion == 'success'"
494525
working-directory: mono_repo
495526
run: pub upgrade --no-precompile
496527
- name: "mono_repo; pub run test -t yaml --test-randomize-ordering-seed=random"
@@ -525,9 +556,11 @@ jobs:
525556
with:
526557
release-channel: dev
527558
- run: dart --version
528-
- uses: actions/checkout@v2
559+
- id: checkout
560+
uses: actions/checkout@v2
529561
- id: test_pkg_pub_upgrade
530562
name: "test_pkg; pub upgrade --no-precompile"
563+
if: "always() && steps.checkout.conclusion == 'success'"
531564
working-directory: test_pkg
532565
run: pub upgrade --no-precompile
533566
- name: "test_pkg; pub run test --test-randomize-ordering-seed=random"

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Created with package:mono_repo v3.4.3
1+
# Created with package:mono_repo v3.4.4
22
language: dart
33

44
jobs:

mono_repo/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 3.4.4
2+
3+
### GitHub Actions
4+
5+
- Always run `pub upgrade|get` steps if checkout succeeds. This ensures that
6+
tests runs for all packages, even if one package test fails in the same
7+
job.
8+
19
## 3.4.3
210

311
### GitHub Actions

mono_repo/lib/src/commands/github/github_yaml.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ extension on CIJobEntry {
252252
'$package; $pubCommand',
253253
pubCommand,
254254
id: pubStepId,
255+
// Run this regardless of the success of other steps other than the
256+
// pub step.
257+
ifCondition: "always() && steps.checkout.conclusion == 'success'",
255258
workingDirectory: package,
256259
));
257260
for (var i = 0; i < commands.length; i++) {
@@ -383,7 +386,10 @@ Map<String, dynamic> _githubJobYaml(
383386
),
384387
_createDartSetup(dartVersion),
385388
{'run': 'dart --version'},
386-
{'uses': 'actions/checkout@v2'},
389+
{
390+
'id': 'checkout',
391+
'uses': 'actions/checkout@v2',
392+
},
387393
for (var command in runCommands) command.runContent,
388394
],
389395
};

mono_repo/lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mono_repo/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: mono_repo
22
description: >-
33
CLI tools to make it easier to manage a single source repository containing
44
multiple Dart packages.
5-
version: 3.4.3
5+
version: 3.4.4
66
repository: https://github.com/google/mono_repo.dart
77

88
environment:

mono_repo/test/script_integration_outputs/readme_github_defaults.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ jobs:
3434
with:
3535
release-channel: dev
3636
- run: dart --version
37-
- uses: actions/checkout@v2
37+
- id: checkout
38+
uses: actions/checkout@v2
3839
- id: sub_pkg_pub_upgrade
3940
name: "sub_pkg; pub upgrade --no-precompile"
41+
if: "always() && steps.checkout.conclusion == 'success'"
4042
working-directory: sub_pkg
4143
run: pub upgrade --no-precompile
4244
- name: sub_pkg; pub run test
@@ -61,9 +63,11 @@ jobs:
6163
with:
6264
release-channel: dev
6365
- run: dart --version
64-
- uses: actions/checkout@v2
66+
- id: checkout
67+
uses: actions/checkout@v2
6568
- id: sub_pkg_pub_upgrade
6669
name: "sub_pkg; pub upgrade --no-precompile"
70+
if: "always() && steps.checkout.conclusion == 'success'"
6771
working-directory: sub_pkg
6872
run: pub upgrade --no-precompile
6973
- name: sub_pkg; pub run test
@@ -81,9 +85,11 @@ jobs:
8185
with:
8286
release-channel: dev
8387
- run: dart --version
84-
- uses: actions/checkout@v2
88+
- id: checkout
89+
uses: actions/checkout@v2
8590
- id: sub_pkg_pub_upgrade
8691
name: "sub_pkg; pub.bat upgrade --no-precompile"
92+
if: "always() && steps.checkout.conclusion == 'success'"
8793
working-directory: sub_pkg
8894
run: pub.bat upgrade --no-precompile
8995
- name: sub_pkg; pub run test

mono_repo/test/script_integration_outputs/readme_github_lints.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ jobs:
3232
with:
3333
release-channel: stable
3434
- run: dart --version
35-
- uses: actions/checkout@v2
35+
- id: checkout
36+
uses: actions/checkout@v2
3637
- name: mono_repo self validate
3738
run: pub global activate mono_repo 1.2.3
3839
- name: mono_repo self validate
@@ -55,9 +56,11 @@ jobs:
5556
with:
5657
release-channel: dev
5758
- run: dart --version
58-
- uses: actions/checkout@v2
59+
- id: checkout
60+
uses: actions/checkout@v2
5961
- id: sub_pkg_pub_upgrade
6062
name: "sub_pkg; pub upgrade --no-precompile"
63+
if: "always() && steps.checkout.conclusion == 'success'"
6164
working-directory: sub_pkg
6265
run: pub upgrade --no-precompile
6366
- name: sub_pkg; dartanalyzer .
@@ -82,9 +85,11 @@ jobs:
8285
with:
8386
release-channel: dev
8487
- run: dart --version
85-
- uses: actions/checkout@v2
88+
- id: checkout
89+
uses: actions/checkout@v2
8690
- id: sub_pkg_pub_upgrade
8791
name: "sub_pkg; pub upgrade --no-precompile"
92+
if: "always() && steps.checkout.conclusion == 'success'"
8893
working-directory: sub_pkg
8994
run: pub upgrade --no-precompile
9095
- name: "sub_pkg; dartfmt -n --set-exit-if-changed ."

tool/ci.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Created with package:mono_repo v3.4.3
2+
# Created with package:mono_repo v3.4.4
33

44
# Support built in commands on windows out of the box.
55
function pub() {

0 commit comments

Comments
 (0)