108 lines
2.4 KiB
YAML
108 lines
2.4 KiB
YAML
stages:
|
|
- coverage
|
|
- builddocs
|
|
- deploy
|
|
- publish
|
|
|
|
workflow:
|
|
rules:
|
|
- if: $CI_MERGE_REQUEST_IID
|
|
- if: $CI_COMMIT_TAG
|
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
|
|
|
coverage:
|
|
tags:
|
|
- linux
|
|
stage: coverage
|
|
image: registry.gitlab.com/famedly/company/frontend/flutter-dockerimages/flutter-linux/stable
|
|
dependencies: []
|
|
script:
|
|
- sed -i 's/#\([^ ]\)/\1/g' pubspec.yaml
|
|
- rm -r example
|
|
- ./scripts/prepare.sh
|
|
- ./scripts/test.sh
|
|
artifacts:
|
|
paths:
|
|
- coverage/
|
|
|
|
coverage_without_olm:
|
|
tags:
|
|
- linux
|
|
stage: coverage
|
|
image: dart
|
|
dependencies: []
|
|
script:
|
|
- dart pub get
|
|
- dart pub run test
|
|
|
|
e2ee_test:
|
|
tags:
|
|
- linux
|
|
stage: coverage
|
|
image: registry.gitlab.com/famedly/company/frontend/flutter-dockerimages/flutter-linux/stable
|
|
dependencies: []
|
|
script:
|
|
- printf "abstract class TestUser {\n static const String homeserver = '$TEST_HOMESERVER';\n static const String username = '$TEST_USER1';\n static const String username2 = '$TEST_USER2';\n static const String password = '$TEST_USER_PASSWORD';\n}" > ./test_driver/test_config.dart
|
|
- ./scripts/prepare.sh
|
|
- ./scripts/test_driver.sh
|
|
timeout: 16m
|
|
resource_group: e2ee_test
|
|
|
|
code_analyze:
|
|
tags:
|
|
- docker
|
|
stage: coverage
|
|
image: dart
|
|
dependencies: []
|
|
script:
|
|
- dart pub get
|
|
- dart format lib/ test/ test_driver/ --set-exit-if-changed
|
|
- dart analyze
|
|
|
|
code_quality:
|
|
tags:
|
|
- docker
|
|
stage: coverage
|
|
image: dart
|
|
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
|
|
image: dart
|
|
script:
|
|
- rm -rf ./docs
|
|
- dart pub get
|
|
- dart pub publish --dry-run
|
|
|
|
|
|
pub-dev:
|
|
stage: publish
|
|
image: dart
|
|
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
|