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

83 lines
1.9 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.3'
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
artifacts:
paths:
- coverage/
coverage_without_olm:
tags:
- linux
stage: test
image: dart
dependencies: []
script:
- dart pub get
- dart pub run test
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 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