Skip to content

Commit

Permalink
Analyzer upgrade (lejard-h#320)
Browse files Browse the repository at this point in the history
Co-authored-by: István Juhos <[email protected]>
  • Loading branch information
JEuler and stewemetal authored Jan 16, 2022
1 parent 0386c74 commit d4dab0d
Show file tree
Hide file tree
Showing 14 changed files with 153 additions and 127 deletions.
167 changes: 96 additions & 71 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Created with package:mono_repo v3.4.7
# Created with package:mono_repo v6.0.0
name: Dart CI
on:
push:
Expand All @@ -21,161 +21,185 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@v2
uses: actions/cache@v2.1.7
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;dart:stable"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- uses: dart-lang/setup-dart@v1.0
- uses: dart-lang/setup-dart@v1.3
with:
sdk: stable
- id: checkout
uses: actions/checkout@v2
uses: actions/checkout@v2.4.0
- name: mono_repo self validate
run: pub global activate mono_repo 3.4.7
run: dart pub global activate mono_repo 6.0.0
- name: mono_repo self validate
run: pub global run mono_repo generate --validate
run: dart pub global run mono_repo generate --validate
job_002:
name: "analyzer_and_format; PKGS: chopper, chopper_built_value, chopper_generator; `dartfmt -n --set-exit-if-changed .`, `dartanalyzer --fatal-infos .`"
name: "analyzer_and_format; PKGS: chopper_built_value, chopper_generator; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@v2
uses: actions/cache@v2.1.7
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;dart:stable;packages:chopper-chopper_built_value-chopper_generator;commands:dartfmt-dartanalyzer"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper_built_value-chopper_generator;commands:format-analyze"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;dart:stable;packages:chopper-chopper_built_value-chopper_generator
os:ubuntu-latest;pub-cache-hosted;dart:stable
os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper_built_value-chopper_generator
os:ubuntu-latest;pub-cache-hosted;sdk:stable
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- uses: dart-lang/setup-dart@v1.0
- uses: dart-lang/setup-dart@v1.3
with:
sdk: stable
- id: checkout
uses: actions/checkout@v2
- id: chopper_pub_upgrade
name: "chopper; pub upgrade --no-precompile"
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: chopper
run: pub upgrade --no-precompile
- name: "chopper; dartfmt -n --set-exit-if-changed ."
if: "always() && steps.chopper_pub_upgrade.conclusion == 'success'"
working-directory: chopper
run: dartfmt -n --set-exit-if-changed .
- name: "chopper; dartanalyzer --fatal-infos ."
if: "always() && steps.chopper_pub_upgrade.conclusion == 'success'"
working-directory: chopper
run: dartanalyzer --fatal-infos .
uses: actions/[email protected]
- id: chopper_built_value_pub_upgrade
name: "chopper_built_value; pub upgrade --no-precompile"
name: chopper_built_value; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: chopper_built_value
run: pub upgrade --no-precompile
- name: "chopper_built_value; dartfmt -n --set-exit-if-changed ."
run: dart pub upgrade
- name: "chopper_built_value; dart format --output=none --set-exit-if-changed ."
if: "always() && steps.chopper_built_value_pub_upgrade.conclusion == 'success'"
working-directory: chopper_built_value
run: dartfmt -n --set-exit-if-changed .
- name: "chopper_built_value; dartanalyzer --fatal-infos ."
run: "dart format --output=none --set-exit-if-changed ."
- name: "chopper_built_value; dart analyze --fatal-infos ."
if: "always() && steps.chopper_built_value_pub_upgrade.conclusion == 'success'"
working-directory: chopper_built_value
run: dartanalyzer --fatal-infos .
run: dart analyze --fatal-infos .
- id: chopper_generator_pub_upgrade
name: "chopper_generator; pub upgrade --no-precompile"
name: chopper_generator; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: chopper_generator
run: pub upgrade --no-precompile
- name: "chopper_generator; dartfmt -n --set-exit-if-changed ."
run: dart pub upgrade
- name: "chopper_generator; dart format --output=none --set-exit-if-changed ."
if: "always() && steps.chopper_generator_pub_upgrade.conclusion == 'success'"
working-directory: chopper_generator
run: dartfmt -n --set-exit-if-changed .
- name: "chopper_generator; dartanalyzer --fatal-infos ."
run: "dart format --output=none --set-exit-if-changed ."
- name: "chopper_generator; dart analyze --fatal-infos ."
if: "always() && steps.chopper_generator_pub_upgrade.conclusion == 'success'"
working-directory: chopper_generator
run: dartanalyzer --fatal-infos .
run: dart analyze --fatal-infos .
job_003:
name: "unit_test; PKGS: chopper, chopper_built_value; `pub run test`"
name: "analyze_and_format; PKG: chopper; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@v2
uses: actions/cache@v2.1.7
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;dart:stable;packages:chopper-chopper_built_value;commands:test_0"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper;commands:format-analyze"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;dart:stable;packages:chopper-chopper_built_value
os:ubuntu-latest;pub-cache-hosted;dart:stable
os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper
os:ubuntu-latest;pub-cache-hosted;sdk:stable
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- uses: dart-lang/setup-dart@v1.0
- uses: dart-lang/setup-dart@v1.3
with:
sdk: stable
- id: checkout
uses: actions/checkout@v2
uses: actions/[email protected]
- id: chopper_pub_upgrade
name: chopper; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: chopper
run: dart pub upgrade
- name: "chopper; dart format --output=none --set-exit-if-changed ."
if: "always() && steps.chopper_pub_upgrade.conclusion == 'success'"
working-directory: chopper
run: "dart format --output=none --set-exit-if-changed ."
- name: "chopper; dart analyze --fatal-infos ."
if: "always() && steps.chopper_pub_upgrade.conclusion == 'success'"
working-directory: chopper
run: dart analyze --fatal-infos .
needs:
- job_001
- job_002
job_004:
name: "unit_test; PKGS: chopper, chopper_built_value; `dart test -p chrome`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/[email protected]
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper-chopper_built_value;commands:test_1"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper-chopper_built_value
os:ubuntu-latest;pub-cache-hosted;sdk:stable
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- uses: dart-lang/[email protected]
with:
sdk: stable
- id: checkout
uses: actions/[email protected]
- id: chopper_pub_upgrade
name: "chopper; pub upgrade --no-precompile"
name: chopper; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: chopper
run: pub upgrade --no-precompile
- name: chopper; pub run test
run: dart pub upgrade
- name: "chopper; dart test -p chrome"
if: "always() && steps.chopper_pub_upgrade.conclusion == 'success'"
working-directory: chopper
run: pub run test
run: dart test -p chrome
- id: chopper_built_value_pub_upgrade
name: "chopper_built_value; pub upgrade --no-precompile"
name: chopper_built_value; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: chopper_built_value
run: pub upgrade --no-precompile
- name: chopper_built_value; pub run test
run: dart pub upgrade
- name: "chopper_built_value; dart test -p chrome"
if: "always() && steps.chopper_built_value_pub_upgrade.conclusion == 'success'"
working-directory: chopper_built_value
run: pub run test
run: dart test -p chrome
needs:
- job_001
- job_002
job_004:
name: "unit_test; PKGS: chopper, chopper_built_value; `pub run test -p chrome`"
- job_003
job_005:
name: "unit_test; PKGS: chopper, chopper_built_value; `dart test`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@v2
uses: actions/cache@v2.1.7
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;dart:stable;packages:chopper-chopper_built_value;commands:test_1"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper-chopper_built_value;commands:test_0"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;dart:stable;packages:chopper-chopper_built_value
os:ubuntu-latest;pub-cache-hosted;dart:stable
os:ubuntu-latest;pub-cache-hosted;sdk:stable;packages:chopper-chopper_built_value
os:ubuntu-latest;pub-cache-hosted;sdk:stable
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- uses: dart-lang/setup-dart@v1.0
- uses: dart-lang/setup-dart@v1.3
with:
sdk: stable
- id: checkout
uses: actions/checkout@v2
uses: actions/checkout@v2.4.0
- id: chopper_pub_upgrade
name: "chopper; pub upgrade --no-precompile"
name: chopper; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: chopper
run: pub upgrade --no-precompile
- name: "chopper; pub run test -p chrome"
run: dart pub upgrade
- name: chopper; dart test
if: "always() && steps.chopper_pub_upgrade.conclusion == 'success'"
working-directory: chopper
run: pub run test -p chrome
run: dart test
- id: chopper_built_value_pub_upgrade
name: "chopper_built_value; pub upgrade --no-precompile"
name: chopper_built_value; dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: chopper_built_value
run: pub upgrade --no-precompile
- name: "chopper_built_value; pub run test -p chrome"
run: dart pub upgrade
- name: chopper_built_value; dart test
if: "always() && steps.chopper_built_value_pub_upgrade.conclusion == 'success'"
working-directory: chopper_built_value
run: pub run test -p chrome
run: dart test
needs:
- job_001
- job_002
job_005:
- job_003
job_006:
name: Coverage
runs-on: ubuntu-latest
steps:
Expand All @@ -195,3 +219,4 @@ jobs:
- job_002
- job_003
- job_004
- job_005
1 change: 0 additions & 1 deletion chopper/example/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:chopper/chopper.dart';
import 'package:chopper/src/interceptor.dart';
import 'definition.dart';

Future<void> main() async {
Expand Down
10 changes: 5 additions & 5 deletions chopper/mono_pkg.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
dart:
- stable
sdk:
- stable

stages:
- analyzer_and_format:
- analyze_and_format:
- group:
- dartfmt
- dartanalyzer: --fatal-infos .
- format
- analyze: --fatal-infos .
- unit_test:
- test:
- test: -p chrome
Expand Down
1 change: 0 additions & 1 deletion chopper/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ description: Chopper is an http client generator using source_gen, inspired by R
version: 4.0.1
documentation: https://hadrien-lejard.gitbook.io/chopper
repository: https://github.com/lejard-h/chopper
author: Hadrien Lejard <[email protected]>

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down
7 changes: 0 additions & 7 deletions chopper/test/base_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ void main() {
errorConverter: errorConverter,
);
group('Base', () {
test('get service', () async {
final chopper = buildClient();
final service = chopper.getService<HttpTestService>();

expect(service is HttpTestService, isTrue);
});

test('get service errors', () async {
final chopper = ChopperClient(
baseUrl: baseUrl,
Expand Down
4 changes: 0 additions & 4 deletions chopper/test/converter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ void main() {
final res = Response(http.Response('"$value"', 200), '"$value"');
final converted = jsonConverter.convertResponse<String, String>(res);

expect(converted is Response<String>, isTrue);
expect(converted.body, equals(value));
});

Expand All @@ -84,15 +83,13 @@ void main() {
final converted =
jsonConverter.convertResponse<List<String>, String>(res);

expect(converted is Response<List<String>>, isTrue);
expect(converted.body, equals(['foo', 'bar']));
});

test('decode List int', () {
final res = Response(http.Response('[1,2]', 200), '[1,2]');
final converted = jsonConverter.convertResponse<List<int>, int>(res);

expect(converted is Response<List<int>>, isTrue);
expect(converted.body, equals([1, 2]));
});

Expand All @@ -104,7 +101,6 @@ void main() {
final converted =
jsonConverter.convertResponse<Map<String, String>, String>(res);

expect(converted is Response<Map<String, String>>, isTrue);
expect(converted.body, equals({'foo': 'bar'}));
});
});
Expand Down
1 change: 0 additions & 1 deletion chopper/test/test_service.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:async';
import 'dart:convert';
import 'package:chopper/chopper.dart';
import 'package:chopper/src/constants.dart';

import 'package:http/http.dart' show MultipartFile;

Expand Down
8 changes: 4 additions & 4 deletions chopper_built_value/mono_pkg.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
dart:
- stable
sdk:
- stable

stages:
- analyzer_and_format:
- group:
- dartfmt
- dartanalyzer: --fatal-infos .
- format
- analyze: --fatal-infos .
- unit_test:
- test:
- test: -p chrome
Expand Down
1 change: 0 additions & 1 deletion chopper_built_value/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ description: A built_value based Converter for Chopper.
version: 1.0.0
documentation: https://hadrien-lejard.gitbook.io/chopper/converters/built-value-converter
repository: https://github.com/lejard-h/chopper
author: Hadrien Lejard <[email protected]>

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down
1 change: 0 additions & 1 deletion chopper_generator/lib/src/generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'package:analyzer/dart/element/nullability_suffix.dart';
import 'package:analyzer/dart/element/type.dart';

import 'package:build/build.dart';
import 'package:build/src/builder/build_step.dart';
import 'package:built_collection/built_collection.dart';
import 'package:dart_style/dart_style.dart';

Expand Down
8 changes: 4 additions & 4 deletions chopper_generator/mono_pkg.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
dart:
- stable
sdk:
- stable

stages:
- analyzer_and_format:
- group:
- dartfmt
- dartanalyzer: --fatal-infos .
- format
- analyze: --fatal-infos .

cache:
directories:
Expand Down
Loading

0 comments on commit d4dab0d

Please sign in to comment.