dart_pkpass/.gitlab-ci.yml
The one with the braid 8e28630523 fix: use correct Dart image
Signed-off-by: The one with the braid <info@braid.business>
2024-07-11 12:01:12 +02:00

75 lines
1.5 KiB
YAML

variables:
FLUTTER_VERSION: 3.22.2
image: registry.gitlab.com/theonewiththebraid/flutter-dockerimages:${FLUTTER_VERSION}-base
stages:
- coverage
- deploy
- publish
workflow:
rules:
- if: $CI_MERGE_REQUEST_IID
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
code_analyze:
stage: coverage
dependencies: []
script:
- dart pub get
- dart format lib test example --set-exit-if-changed
- dart analyze
- dart run import_sorter:main --no-comments --exit-if-changed
dart_test:
stage: coverage
dependencies: [
code_analyze
]
script:
- dart pub get
- dart test
code_quality:
stage: coverage
before_script:
- dart pub global activate dart_code_metrics
script:
- dart pub global run dart_code_metrics:metrics analyze lib -r gitlab > code-quality-report.json
artifacts:
reports:
codequality: code-quality-report.json
# also create an actual artifact for inspection purposes
paths:
- code-quality-report.json
dry-run:
stage: publish
script:
- rm -rf ./docs
- dart pub get
- dart pub publish --dry-run
pub-dev:
stage: publish
dependencies: [
dry-run
]
script:
- rm -rf ./docs
- |
if [ -z "${PUB_DEV_CREDENTIALS}" ]; then
echo "Missing PUB_DEV_CREDENTIALS environment variable"
exit 1
fi
mkdir -p ~/.config/dart
cp "${PUB_DEV_CREDENTIALS}" ~/.config/dart/pub-credentials.json
- dart pub get
- dart pub publish --force
rules:
- if: $CI_COMMIT_TAG