From adb2700a135f81a7d5fd69b08004e6d0fb162b93 Mon Sep 17 00:00:00 2001 From: team-nimblehq Date: Mon, 13 Nov 2023 04:41:28 +0000 Subject: [PATCH] [Chore] Generate & update sample project --- sample/.github/workflows/test.yml | 11 +++++++++++ sample/dangerfile.dart | 7 +++++++ sample/pubspec.yaml | 1 + 3 files changed, 19 insertions(+) create mode 100644 sample/dangerfile.dart diff --git a/sample/.github/workflows/test.yml b/sample/.github/workflows/test.yml index 2848761f..47af0f08 100644 --- a/sample/.github/workflows/test.yml +++ b/sample/.github/workflows/test.yml @@ -36,6 +36,17 @@ jobs: - name: Statically analyze the Dart code for any errors run: flutter analyze . + - name: Install Danger JS + run: npm install -g danger + + - name: Activate Danger Dart + run: dart pub global activate danger_dart + + - name: Run danger ci + run: danger_dart ci + env: + GITHUB_TOKEN: $ + - name: Run widget tests, unit tests run: flutter test --machine --coverage diff --git a/sample/dangerfile.dart b/sample/dangerfile.dart new file mode 100644 index 00000000..3d236c4d --- /dev/null +++ b/sample/dangerfile.dart @@ -0,0 +1,7 @@ +import 'package:danger_core/danger_core.dart'; + +void main() { + if (danger.github.pr.title.contains('WIP')) { + warn('PR is considered WIP'); + } +} diff --git a/sample/pubspec.yaml b/sample/pubspec.yaml index 5f3d20ad..106376d3 100644 --- a/sample/pubspec.yaml +++ b/sample/pubspec.yaml @@ -61,6 +61,7 @@ dev_dependencies: json_serializable: ^6.6.2 mockito: ^5.4.0 retrofit_generator: ^7.0.0 + danger_core: # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec