-
Notifications
You must be signed in to change notification settings - Fork 38
/
.gitlab-ci.yml
130 lines (122 loc) · 3.66 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
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