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/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. diff --git a/melos.yaml b/melos.yaml index 5d814ff0..3430ffd7 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,38 @@ 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 + gen-class-models: + run: melos exec -- dart pub global run dcdg -o models/class-models.puml + select-package: + ignore: + - '*example*' + + quality-check: + run: | + melos clean && \ + 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: > 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