From 9af76b8e1f47c39f6b05df63730e1dbd037ccd64 Mon Sep 17 00:00:00 2001 From: Hugo Pointcheval Date: Sun, 11 Dec 2022 20:20:32 -0500 Subject: [PATCH] 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: >