From 21b18054bacb7d92ccda5b6aac4ce70cb5c7934b Mon Sep 17 00:00:00 2001 From: Hugo Pointcheval Date: Thu, 8 Dec 2022 17:43:11 -0500 Subject: [PATCH 1/5] chore(package): clean unimplemented tests --- .../test/wyatt_architecture_test.dart | 17 ----------------- .../test/wyatt_crud_bloc_test.dart | 0 .../test/wyatt_wyatt_ui_components_test.dart | 17 ----------------- 3 files changed, 34 deletions(-) delete mode 100644 packages/wyatt_architecture/test/wyatt_architecture_test.dart delete mode 100644 packages/wyatt_crud_bloc/test/wyatt_crud_bloc_test.dart delete mode 100644 packages/wyatt_ui_components/test/wyatt_wyatt_ui_components_test.dart diff --git a/packages/wyatt_architecture/test/wyatt_architecture_test.dart b/packages/wyatt_architecture/test/wyatt_architecture_test.dart deleted file mode 100644 index dc7ea003..00000000 --- a/packages/wyatt_architecture/test/wyatt_architecture_test.dart +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (C) 2022 WYATT GROUP -// Please see the AUTHORS file for details. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// Nothing to test as there is no logic in this package. diff --git a/packages/wyatt_crud_bloc/test/wyatt_crud_bloc_test.dart b/packages/wyatt_crud_bloc/test/wyatt_crud_bloc_test.dart deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/wyatt_ui_components/test/wyatt_wyatt_ui_components_test.dart b/packages/wyatt_ui_components/test/wyatt_wyatt_ui_components_test.dart deleted file mode 100644 index 1a98696c..00000000 --- a/packages/wyatt_ui_components/test/wyatt_wyatt_ui_components_test.dart +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (C) 2022 WYATT GROUP -// Please see the AUTHORS file for details. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// TODO(wyatt): Add some tests \ No newline at end of file -- 2.47.2 From a19d4bc5ce27c8900f892742d88354f7bbd0e243 Mon Sep 17 00:00:00 2001 From: Hugo Pointcheval Date: Thu, 8 Dec 2022 17:45:57 -0500 Subject: [PATCH 2/5] chore: update melos config --- melos.yaml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/melos.yaml b/melos.yaml index 5d814ff0..e854b4a8 100644 --- a/melos.yaml +++ b/melos.yaml @@ -21,8 +21,7 @@ scripts: analyze: run: | - melos exec -c 10 -- \ - flutter analyze --fatal-infos + melos exec -c 1 -- flutter analyze --fatal-infos description: Run `flutter analyze` for all packages. format: @@ -38,18 +37,29 @@ scripts: description: Clean things very deeply with `git clean`. test:selective_unit_test: - run: melos exec --dir-exists="test" -- flutter test --no-pub --coverage + run: melos exec -- flutter test --no-pub --coverage description: Run Flutter tests for a specific package in this project. select-package: flutter: true + dir-exists: + - test + ignore: + - '*example*' - test: + test:all: run: melos run test:selective_unit_test --no-select description: Run all Flutter tests in this project. gen-coverage: melos exec -- sh "\$MELOS_ROOT_PATH/combine_coverage.sh" && genhtml coverage/lcov.info -o coverage/html gen-class-models: melos exec --scope="*wyatt_*" -- dart pub global run dcdg -o models/class-models.puml + + qualitycheck: + run: | + melos clean && \ + melos bootstrap && \ + melos run test:all + description: Run all targets generally expected in CI for a full local quality check. # Additional cleanup lifecycle script, executed when `melos clean` is run. postclean: > -- 2.47.2 From 5593620181f9eb88eab8991e9b8ac2d62377a3c5 Mon Sep 17 00:00:00 2001 From: Hugo Pointcheval Date: Thu, 8 Dec 2022 18:13:23 -0500 Subject: [PATCH 3/5] refactor: change quality check rule name --- melos.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/melos.yaml b/melos.yaml index e854b4a8..5f48aec3 100644 --- a/melos.yaml +++ b/melos.yaml @@ -54,7 +54,7 @@ scripts: gen-class-models: melos exec --scope="*wyatt_*" -- dart pub global run dcdg -o models/class-models.puml - qualitycheck: + quality-check: run: | melos clean && \ melos bootstrap && \ -- 2.47.2 From 9af76b8e1f47c39f6b05df63730e1dbd037ccd64 Mon Sep 17 00:00:00 2001 From: Hugo Pointcheval Date: Sun, 11 Dec 2022 20:20:32 -0500 Subject: [PATCH 4/5] ci: add package tests and validation --- .drone.yml | 32 ++++++++++++++++++++++++++++++++ melos.yaml | 13 +++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 00000000..6581b2f6 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,32 @@ +# Copyright (C) 2022 WYATT GROUP +# Please see the AUTHORS file for details. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +kind: pipeline +type: docker +name: build + +steps: +- name: build + image: git.wyatt-studio.fr/wyatt-foss/flutter-melos:2.9.0 + commands: + - melos run quality-check + - melos run publish:validate + +trigger: + branch: + - master + event: + - push \ No newline at end of file diff --git a/melos.yaml b/melos.yaml index 5f48aec3..3430ffd7 100644 --- a/melos.yaml +++ b/melos.yaml @@ -40,7 +40,6 @@ scripts: run: melos exec -- flutter test --no-pub --coverage description: Run Flutter tests for a specific package in this project. select-package: - flutter: true dir-exists: - test ignore: @@ -52,7 +51,11 @@ scripts: gen-coverage: melos exec -- sh "\$MELOS_ROOT_PATH/combine_coverage.sh" && genhtml coverage/lcov.info -o coverage/html - gen-class-models: melos exec --scope="*wyatt_*" -- dart pub global run dcdg -o models/class-models.puml + gen-class-models: + run: melos exec -- dart pub global run dcdg -o models/class-models.puml + select-package: + ignore: + - '*example*' quality-check: run: | @@ -60,6 +63,12 @@ scripts: melos bootstrap && \ melos run test:all description: Run all targets generally expected in CI for a full local quality check. + + publish:validate: + run: melos publish --diff="origin/$DRONE_COMMIT_BRANCH...HEAD" --yes + + # publish: + # run: melos publish --diff="origin/$DRONE_COMMIT_BRANCH...HEAD" --no-dry-run --yes # Additional cleanup lifecycle script, executed when `melos clean` is run. postclean: > -- 2.47.2 From 1e305c75bd43b36af4d6690886054ef70a17d0a7 Mon Sep 17 00:00:00 2001 From: Hugo Pointcheval Date: Sun, 11 Dec 2022 21:28:47 -0500 Subject: [PATCH 5/5] docs: update readme with melos commands --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index babeca68..b6ec3314 100644 --- a/README.md +++ b/README.md @@ -171,10 +171,16 @@ Note that your issue will be close after merging on master. Before closing the issue, please check tests and update coverage. You might run : ```shell -melos run test -melos run gen_coverage +melos run test:all # this will run all tests in this project +melos run gen-coverage # this will generate coverage report +melos run gen-class-models # this will generate plantuml class diagrams +melos run quality-check # this will run all targets generally expected in CI +melos run publish:validate # this will run a validation before publish packages +melos run publish # this will publish packages ``` +> Note that only modified package will be verified and published. + #### Merge your work After closing your issue, some work may have been done on master in the meantime. To keep a clean git history, please rebase before opening a change request. -- 2.47.2