Skip to content

Commit ff0e0fd

Browse files
authored
Standardize analyze across packages (google#1345)
- analyze fatal infos + format on dev - just analyze on "pubspec"
1 parent 4e8e9ac commit ff0e0fd

File tree

5 files changed

+45
-77
lines changed

5 files changed

+45
-77
lines changed

.github/workflows/dart.yml

+29-76
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ jobs:
4040
- name: mono_repo self validate
4141
run: dart pub global run mono_repo generate --validate
4242
job_002:
43-
name: "analyzer_and_format; Dart 3.0.0; PKGS: _test_yaml, checked_yaml, example, json_serializable; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`"
43+
name: "analyzer_and_format; Dart 3.0.0; PKGS: _test_yaml, checked_yaml, example, json_annotation, json_serializable; `dart analyze`"
4444
runs-on: ubuntu-latest
4545
steps:
4646
- name: Cache Pub hosted dependencies
4747
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
4848
with:
4949
path: "~/.pub-cache/hosted"
50-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:_test_yaml-checked_yaml-example-json_serializable;commands:format-analyze_0"
50+
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:_test_yaml-checked_yaml-example-json_annotation-json_serializable;commands:analyze_1"
5151
restore-keys: |
52-
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:_test_yaml-checked_yaml-example-json_serializable
52+
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:_test_yaml-checked_yaml-example-json_annotation-json_serializable
5353
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0
5454
os:ubuntu-latest;pub-cache-hosted
5555
os:ubuntu-latest
@@ -65,74 +65,28 @@ jobs:
6565
run: dart pub upgrade
6666
if: "always() && steps.checkout.conclusion == 'success'"
6767
working-directory: _test_yaml
68-
- name: "_test_yaml; dart format --output=none --set-exit-if-changed ."
69-
run: "dart format --output=none --set-exit-if-changed ."
70-
if: "always() && steps._test_yaml_pub_upgrade.conclusion == 'success'"
71-
working-directory: _test_yaml
72-
- name: "_test_yaml; dart analyze --fatal-infos ."
73-
run: dart analyze --fatal-infos .
68+
- name: _test_yaml; dart analyze
69+
run: dart analyze
7470
if: "always() && steps._test_yaml_pub_upgrade.conclusion == 'success'"
7571
working-directory: _test_yaml
7672
- id: checked_yaml_pub_upgrade
7773
name: checked_yaml; dart pub upgrade
7874
run: dart pub upgrade
7975
if: "always() && steps.checkout.conclusion == 'success'"
8076
working-directory: checked_yaml
81-
- name: "checked_yaml; dart format --output=none --set-exit-if-changed ."
82-
run: "dart format --output=none --set-exit-if-changed ."
83-
if: "always() && steps.checked_yaml_pub_upgrade.conclusion == 'success'"
84-
working-directory: checked_yaml
85-
- name: "checked_yaml; dart analyze --fatal-infos ."
86-
run: dart analyze --fatal-infos .
77+
- name: checked_yaml; dart analyze
78+
run: dart analyze
8779
if: "always() && steps.checked_yaml_pub_upgrade.conclusion == 'success'"
8880
working-directory: checked_yaml
8981
- id: example_pub_upgrade
9082
name: example; dart pub upgrade
9183
run: dart pub upgrade
9284
if: "always() && steps.checkout.conclusion == 'success'"
9385
working-directory: example
94-
- name: "example; dart format --output=none --set-exit-if-changed ."
95-
run: "dart format --output=none --set-exit-if-changed ."
96-
if: "always() && steps.example_pub_upgrade.conclusion == 'success'"
97-
working-directory: example
98-
- name: "example; dart analyze --fatal-infos ."
99-
run: dart analyze --fatal-infos .
86+
- name: example; dart analyze
87+
run: dart analyze
10088
if: "always() && steps.example_pub_upgrade.conclusion == 'success'"
10189
working-directory: example
102-
- id: json_serializable_pub_upgrade
103-
name: json_serializable; dart pub upgrade
104-
run: dart pub upgrade
105-
if: "always() && steps.checkout.conclusion == 'success'"
106-
working-directory: json_serializable
107-
- name: "json_serializable; dart format --output=none --set-exit-if-changed ."
108-
run: "dart format --output=none --set-exit-if-changed ."
109-
if: "always() && steps.json_serializable_pub_upgrade.conclusion == 'success'"
110-
working-directory: json_serializable
111-
- name: "json_serializable; dart analyze --fatal-infos ."
112-
run: dart analyze --fatal-infos .
113-
if: "always() && steps.json_serializable_pub_upgrade.conclusion == 'success'"
114-
working-directory: json_serializable
115-
job_003:
116-
name: "analyzer_and_format; Dart 3.0.0; PKG: json_annotation; `dart analyze`"
117-
runs-on: ubuntu-latest
118-
steps:
119-
- name: Cache Pub hosted dependencies
120-
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
121-
with:
122-
path: "~/.pub-cache/hosted"
123-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:json_annotation;commands:analyze_1"
124-
restore-keys: |
125-
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:json_annotation
126-
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0
127-
os:ubuntu-latest;pub-cache-hosted
128-
os:ubuntu-latest
129-
- name: Setup Dart SDK
130-
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
131-
with:
132-
sdk: "3.0.0"
133-
- id: checkout
134-
name: Checkout repository
135-
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
13690
- id: json_annotation_pub_upgrade
13791
name: json_annotation; dart pub upgrade
13892
run: dart pub upgrade
@@ -142,7 +96,16 @@ jobs:
14296
run: dart analyze
14397
if: "always() && steps.json_annotation_pub_upgrade.conclusion == 'success'"
14498
working-directory: json_annotation
145-
job_004:
99+
- id: json_serializable_pub_upgrade
100+
name: json_serializable; dart pub upgrade
101+
run: dart pub upgrade
102+
if: "always() && steps.checkout.conclusion == 'success'"
103+
working-directory: json_serializable
104+
- name: json_serializable; dart analyze
105+
run: dart analyze
106+
if: "always() && steps.json_serializable_pub_upgrade.conclusion == 'success'"
107+
working-directory: json_serializable
108+
job_003:
146109
name: "analyzer_and_format; Dart dev; PKGS: _test_yaml, checked_yaml, example, json_annotation, json_serializable; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`"
147110
runs-on: ubuntu-latest
148111
steps:
@@ -228,7 +191,7 @@ jobs:
228191
run: dart analyze --fatal-infos .
229192
if: "always() && steps.json_serializable_pub_upgrade.conclusion == 'success'"
230193
working-directory: json_serializable
231-
job_005:
194+
job_004:
232195
name: "unit_test; Dart 3.0.0; PKGS: _test_yaml, checked_yaml, example, json_serializable; `dart test`"
233196
runs-on: ubuntu-latest
234197
steps:
@@ -289,8 +252,7 @@ jobs:
289252
- job_001
290253
- job_002
291254
- job_003
292-
- job_004
293-
job_006:
255+
job_005:
294256
name: "unit_test; Dart 3.0.0; PKG: json_serializable; `dart test --run-skipped -t presubmit-only test/annotation_version_test.dart`"
295257
runs-on: ubuntu-latest
296258
steps:
@@ -324,8 +286,7 @@ jobs:
324286
- job_001
325287
- job_002
326288
- job_003
327-
- job_004
328-
job_007:
289+
job_006:
329290
name: "unit_test; Dart 3.0.0; PKG: json_serializable; `dart test --run-skipped -t presubmit-only test/ensure_build_test.dart`"
330291
runs-on: ubuntu-latest
331292
steps:
@@ -359,8 +320,7 @@ jobs:
359320
- job_001
360321
- job_002
361322
- job_003
362-
- job_004
363-
job_008:
323+
job_007:
364324
name: "unit_test; Dart 3.0.0; PKG: json_serializable; `dart test -p chrome`"
365325
runs-on: ubuntu-latest
366326
steps:
@@ -394,8 +354,7 @@ jobs:
394354
- job_001
395355
- job_002
396356
- job_003
397-
- job_004
398-
job_009:
357+
job_008:
399358
name: "unit_test; Dart dev; PKGS: _test_yaml, checked_yaml, example, json_serializable; `dart test`"
400359
runs-on: ubuntu-latest
401360
steps:
@@ -456,8 +415,7 @@ jobs:
456415
- job_001
457416
- job_002
458417
- job_003
459-
- job_004
460-
job_010:
418+
job_009:
461419
name: "unit_test; Dart dev; PKG: json_serializable; `dart test --run-skipped -t presubmit-only test/annotation_version_test.dart`"
462420
runs-on: ubuntu-latest
463421
steps:
@@ -491,8 +449,7 @@ jobs:
491449
- job_001
492450
- job_002
493451
- job_003
494-
- job_004
495-
job_011:
452+
job_010:
496453
name: "unit_test; Dart dev; PKG: json_serializable; `dart test --run-skipped -t presubmit-only test/ensure_build_test.dart`"
497454
runs-on: ubuntu-latest
498455
steps:
@@ -526,8 +483,7 @@ jobs:
526483
- job_001
527484
- job_002
528485
- job_003
529-
- job_004
530-
job_012:
486+
job_011:
531487
name: "unit_test; Dart dev; PKG: json_serializable; `dart test -p chrome`"
532488
runs-on: ubuntu-latest
533489
steps:
@@ -561,8 +517,7 @@ jobs:
561517
- job_001
562518
- job_002
563519
- job_003
564-
- job_004
565-
job_013:
520+
job_012:
566521
name: "ensure_build; Dart 3.0.0; PKGS: _test_yaml, checked_yaml, example; `dart test --run-skipped -t presubmit-only test/ensure_build_test.dart`"
567522
runs-on: ubuntu-latest
568523
steps:
@@ -622,8 +577,7 @@ jobs:
622577
- job_009
623578
- job_010
624579
- job_011
625-
- job_012
626-
job_014:
580+
job_013:
627581
name: "ensure_build; Dart dev; PKGS: _test_yaml, checked_yaml, example; `dart test --run-skipped -t presubmit-only test/ensure_build_test.dart`"
628582
runs-on: ubuntu-latest
629583
steps:
@@ -683,4 +637,3 @@ jobs:
683637
- job_009
684638
- job_010
685639
- job_011
686-
- job_012

_test_yaml/mono_pkg.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ stages:
88
- group:
99
- format
1010
- analyze: --fatal-infos .
11+
sdk: dev
12+
- group:
13+
- analyze
14+
sdk: pubspec
1115
- unit_test:
1216
- test
1317
- ensure_build:

checked_yaml/mono_pkg.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ stages:
88
- group:
99
- format
1010
- analyze: --fatal-infos .
11-
11+
sdk: dev
12+
- group:
13+
- analyze
14+
sdk: pubspec
1215
- unit_test:
1316
- test
1417
- ensure_build:

example/mono_pkg.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ stages:
88
- group:
99
- format
1010
- analyze: --fatal-infos .
11+
sdk: dev
12+
- group:
13+
- analyze
14+
sdk: pubspec
1115
- unit_test:
1216
- test
1317
- ensure_build:

json_serializable/mono_pkg.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ stages:
88
- group:
99
- format
1010
- analyze: --fatal-infos .
11+
sdk: dev
12+
- group:
13+
- analyze
14+
sdk: pubspec
1115
- unit_test:
1216
- test:
1317
- test: -p chrome

0 commit comments

Comments
 (0)