forked from akvorado/akvorado
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
83 lines (79 loc) · 2.15 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
---
stages:
- tests
- build
run tests:
stage: tests
image: golang:1.19-alpine
cache:
- key:
files:
- go.sum
paths:
- .go-cache/
- bin/
- key:
files:
- console/frontend/package-lock.json
paths:
- .npm-cache
variables:
FF_NETWORK_PER_BUILD: "true"
CI_AKVORADO_FUNCTIONAL_TESTS: "true"
ALLOW_ANONYMOUS_LOGIN: "yes"
ALLOW_PLAINTEXT_LISTENER: "yes"
KAFKA_BROKER_ID: "1"
KAFKA_CFG_LISTENERS: "PLAINTEXT://:9092"
KAFKA_CFG_ADVERTISED_LISTENERS: "PLAINTEXT://kafka:9092"
KAFKA_CFG_ZOOKEEPER_CONNECT: "zookeeper:2181"
services:
- name: bitnami/zookeeper:3.6
alias: zookeeper
- name: bitnami/kafka:2.8.1
alias: kafka
- name: clickhouse/clickhouse-server:22.8
alias: clickhouse
script:
- time apk add --no-cache git make gcc musl-dev protoc shared-mime-info npm curl
- export GOMODCACHE=$PWD/.go-cache
- npm config --user set cache $PWD/.npm-cache
- time go mod download
- time make && ./bin/akvorado version
- time make test
- time make test-race || make test-race
- time make test-coverage-xml || make test-coverage-xml
coverage: '/Code coverage: [0-9.]+/'
artifacts:
reports:
junit: test/tests.xml
coverage_report:
coverage_format: cobertura
path: test/coverage.xml
# To execute manually:
# gitlab-runner exec docker "run tests"
build docker image:
stage: build
image: docker:stable
rules:
- if: $CI_COMMIT_BRANCH == "main"
- if: $CI_MERGE_REQUEST_ID
script:
- |
mkdir -p ~/.docker
cat <<EOF > ~/.docker/config.json
{
"proxies":
{
"default":
{
"httpProxy": "$http_proxy",
"httpsProxy": "$https_proxy",
"noProxy": "127.0.0.1/8${NO_PROXY:+,}NO_PROXY${no_proxy:+,}$no_proxy"
}
}
}
EOF
- docker info
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH$CI_MERGE_REQUEST_ID .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH$CI_MERGE_REQUEST_ID