Skip to content

Commit

Permalink
chore: Update cicd and dependencies (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
spydon committed Sep 11, 2023
1 parent b84093c commit 8767129
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 89 deletions.
38 changes: 15 additions & 23 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,36 @@ jobs:
dartdoc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
- run: flutter pub get # make sure flutter downloads dart for us
- run: ./scripts/dartdoc.sh
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
- run: dart pub get
- run: dart pub run dartdoc --no-auto-include-dependencies --quiet

format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
- run: flutter pub get # make sure flutter downloads dart for us
- run: ./scripts/format.sh
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
- run: dart pub get
- run: dart format --output=none --set-exit-if-changed .

analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
- run: flutter pub get # make sure flutter downloads dart for us
- run: ./scripts/analyze.sh
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
- run: dart pub get
- run: dart analyze
# END LINTING STAGE

# BEGIN TESTING STAGE
test:
needs: [dartdoc, format, analyze]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
- run: flutter pub get # make sure flutter downloads dart for us
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
- run: dart pub get
- run: ./scripts/coverage.sh
- uses: coverallsapp/github-action@master
with:
Expand Down
2 changes: 2 additions & 0 deletions example/ordered_set_example.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: avoid_print

import 'package:ordered_set/comparing.dart';
import 'package:ordered_set/ordered_set.dart';

Expand Down
2 changes: 1 addition & 1 deletion lib/queryable_ordered_set.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'ordered_set.dart';
import 'package:ordered_set/ordered_set.dart';

class _CacheEntry<C, T> {
final List<C> data;
Expand Down
9 changes: 4 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ environment:
sdk: '>=2.14.0 <3.0.0'

dev_dependencies:
test: ^1.17.10
dart_code_metrics: ^4.6.0
dartdoc: ^4.1.0
coverage: ^1.0.3
flame_lint: ^0.0.1
coverage: ^1.6.3
dartdoc: ^6.3.0
flame_lint: ^1.1.0
test: ^1.24.6
18 changes: 0 additions & 18 deletions scripts/analyze.sh

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/build.sh

This file was deleted.

2 changes: 0 additions & 2 deletions scripts/coverage.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash -xe

dart pub get

dart test --coverage=coverage .

dart pub run coverage:format_coverage \
Expand Down
4 changes: 0 additions & 4 deletions scripts/dartdoc.sh

This file was deleted.

10 changes: 0 additions & 10 deletions scripts/format.sh

This file was deleted.

14 changes: 0 additions & 14 deletions scripts/lint.sh

This file was deleted.

22 changes: 14 additions & 8 deletions test/ordered_set_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ void main() {

a.addAll([e1, e2, e3, e4]);
e1.priority = 2;
// no rebalance! note that this is a broken state until rebalance is called
// no rebalance! note that this is a broken state until rebalance is
// called.
expect(a.remove(e1), true);
expect(a.toList().join(), 'e2e3e4');
});
Expand Down Expand Up @@ -257,13 +258,18 @@ void main() {
final a = OrderedSet<ComparableObject>(
(a, b) => -a.priority.compareTo(b.priority),
);
ComparableObject a1, a2, a3, a4, a5, a6;
expect(a.add(a6 = ComparableObject(0, '6')), true);
expect(a.add(a3 = ComparableObject(1, '3')), true);
expect(a.add(a4 = ComparableObject(1, '4')), true);
expect(a.add(a5 = ComparableObject(1, '5')), true);
expect(a.add(a1 = ComparableObject(2, '1')), true);
expect(a.add(a2 = ComparableObject(2, '2')), true);
final a1 = ComparableObject(2, '1');
final a2 = ComparableObject(2, '2');
final a3 = ComparableObject(1, '3');
final a4 = ComparableObject(1, '4');
final a5 = ComparableObject(1, '5');
final a6 = ComparableObject(0, '6');
expect(a.add(a6), true);
expect(a.add(a3), true);
expect(a.add(a4), true);
expect(a.add(a5), true);
expect(a.add(a1), true);
expect(a.add(a2), true);
expect(a.toList().join(), '123456');

expect(a.remove(a4), true);
Expand Down

0 comments on commit 8767129

Please sign in to comment.