matrix-dart-sdk/.gitlab-ci.yml

106 lines
2.8 KiB
YAML

include:
- project: "famedly/company/frontend/ci-templates"
ref: main
file: "/all.yml"
workflow:
rules:
- if: $CI_MERGE_REQUEST_IID
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
variables:
FLUTTER_IMAGE_TAG: "3.0.5"
coverage:
tags:
- linux
stage: test
image: registry.gitlab.com/famedly/company/frontend/flutter-dockerimages/flutter-linux/stable:${FLUTTER_IMAGE_TAG}
dependencies: []
script:
- sed -i 's/#\([^ ]\)/\1/g' pubspec.yaml
- rm -r example
- ./scripts/prepare.sh
- ./scripts/test.sh
coverage: /^\s*lines\.*:\s*\d+.\d+\%/
artifacts:
when: always
paths:
- coverage/
- coverage.xml
- TEST-report.xml
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
junit: TEST-report.xml
coverage_without_olm:
tags:
- linux
stage: test
image: dart
dependencies: []
variables:
NO_OLM: 1
before_script:
- apt-get update && apt-get install --no-install-recommends --no-install-suggests -y curl lcov python3 python3-distutils
- curl -o /bin/lcov_cobertura.py https://raw.githubusercontent.com/eriwen/lcov-to-cobertura-xml/master/lcov_cobertura/lcov_cobertura.py && sed 's/env python/env python3/' -i /bin/lcov_cobertura.py && chmod +x /bin/lcov_cobertura.py
script:
- dart pub get
- ./scripts/test.sh
coverage: /^\s*lines\.*:\s*\d+.\d+\%/
artifacts:
when: always
paths:
- coverage/
- coverage.xml
- TEST-report.xml
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
junit: TEST-report.xml
e2ee_test:
tags:
- linux
stage: test
image: registry.gitlab.com/famedly/company/frontend/flutter-dockerimages/flutter-linux/stable:${FLUTTER_IMAGE_TAG}
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 displayname = '$TEST_USER1_NAME';\n static const String displayname2 = '$TEST_USER2_NAME';\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
dry-run:
stage: deploy
image: dart
script:
- rm -rf ./docs
- dart pub get
- dart pub publish --dry-run
pub-dev:
stage: deploy
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