131 lines
3.7 KiB
YAML
131 lines
3.7 KiB
YAML
include:
|
|
- project: "famedly/company/frontend/ci-templates"
|
|
ref: main
|
|
file: "/all.yml"
|
|
rules:
|
|
- if: $OVERRIDE_INCLUDE_BRANCH == null || $OVERRIDE_INCLUDE_BRANCH == ""
|
|
- project: "famedly/company/frontend/ci-templates"
|
|
ref: $OVERRIDE_INCLUDE_BRANCH
|
|
file: "/all.yml"
|
|
rules:
|
|
- if: $OVERRIDE_INCLUDE_BRANCH
|
|
|
|
variables:
|
|
FLUTTER_IMAGE_TAG: "3.10.4"
|
|
DART_IMAGE_TAG: "3.0.3"
|
|
OVERRIDE_INCLUDE_BRANCH:
|
|
description: "Change the branch used to include the CI template"
|
|
value: "main"
|
|
|
|
coverage:
|
|
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:
|
|
stage: test
|
|
image: dart:${DART_IMAGE_TAG}
|
|
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 libsqlite3-dev
|
|
- 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+\%/ <- broken see https://github.com/dart-lang/test/issues/1698
|
|
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:
|
|
stage: test
|
|
image:
|
|
name: registry.gitlab.com/famedly/company/frontend/flutter-dockerimages/flutter/stable:${FLUTTER_IMAGE_TAG}
|
|
pull_policy: if-not-present
|
|
services:
|
|
- name: docker:dind
|
|
alias: docker
|
|
variables:
|
|
# activate container-to-container networking
|
|
FF_NETWORK_PER_BUILD: "true"
|
|
# Tell docker CLI how to talk to Docker daemon.
|
|
DOCKER_HOST: tcp://docker:2375/
|
|
# Use the overlayfs driver for improved performance.
|
|
DOCKER_DRIVER: overlay2
|
|
# Disable TLS since we're running inside local network.
|
|
DOCKER_TLS_CERTDIR: ""
|
|
HOMESERVER: docker
|
|
dependencies: []
|
|
parallel:
|
|
matrix:
|
|
- HOMESERVER_IMPLEMENTATION:
|
|
- synapse
|
|
- dendrite
|
|
- conduit
|
|
before_script:
|
|
- scripts/integration-prepare-alpine.sh
|
|
# deploy homeserver instance
|
|
- scripts/integration-server-$HOMESERVER_IMPLEMENTATION.sh
|
|
script:
|
|
# create test user environment variables
|
|
- source scripts/integration-create-environment-variables.sh
|
|
# properly set the homeserver IP and create test users
|
|
- scripts/integration-prepare-homeserver.sh
|
|
# setup OLM
|
|
- scripts/prepare.sh
|
|
- scripts/test_driver.sh
|
|
timeout: 10m
|
|
|
|
dry-run:
|
|
stage: deploy
|
|
image: dart:${DART_IMAGE_TAG}
|
|
script:
|
|
- dart pub get
|
|
- dart pub publish --dry-run
|
|
|
|
pub-dev:
|
|
stage: deploy
|
|
image: dart:${DART_IMAGE_TAG}
|
|
dependencies: [dry-run]
|
|
script:
|
|
- |
|
|
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
|