forked from elastos/Elastos.ELA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
75 lines (73 loc) · 2.22 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
stages:
- unit_test
- integration_test
job_test1:
stage: unit_test
image:
name: golang:1.12.6-stretch
entrypoint: ["/bin/sh", "-c"]
variables:
GOPATH: /builds/go
ORG_NAME: "elastos"
PROJECT_NAME: "Elastos.ELA"
ORG_DIR: "${GOPATH}/src/github.com/${ORG_NAME}"
before_script:
- mkdir -p "${GOPATH}/src"
- cd "${GOPATH}/src"
- curl -O http://172.16.0.120/golang.org.tgz
- curl -O http://172.16.0.120/gopkg.in.tgz
- curl -O http://172.16.0.120/github.com.tgz
- tar xf golang.org.tgz
- tar xf gopkg.in.tgz
- tar xf github.com.tgz
- rm -f *.tgz
- mkdir -p "${ORG_DIR}"
- ln -s "${CI_PROJECT_DIR}" "${ORG_DIR}/${PROJECT_NAME}"
script:
- cd "${ORG_DIR}/${PROJECT_NAME}"
- curl -o /bin/addlicense http://172.16.0.120/addlicense
- curl -o /bin/revive http://172.16.120/revive
- curl -o /bin/checkcoverage http://172.16.120/checkcoverage
- chmod +x /bin/addlicense /bin/revive /bin/checkcoverage
- addlicense -check
- revive -config .revive.toml -formatter friendly $(go list ./... | grep -v /vendor/)
- go test $(go list ./... | grep -v /vendor/) -v -short -coverprofile .coverage
- go tool cover -func .coverage
- checkcoverage
- make all
- make dns
- mkdir bin && cp ela ela-cli bin
- bin/ela -v
- ./util.sh test
- cd $CI_PROJECT_DIR
coverage: '/^total:\t+\(statements\)\t+(\d+\.\d+)%/'
artifacts:
name: "$CI_COMMIT_REF_SLUG-$CI_PIPELINE_ID-${CI_BUILD_REF:0:8}"
paths:
- bin/
job_test2:
stage: integration_test
image: python:3.6-jessie
variables:
GOPATH: /builds/go
ORG_NAME: "elastos"
PROJECT_NAME: "Elastos.ELA"
ORG_DIR: "${GOPATH}/src/github.com/${ORG_NAME}"
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
paths:
- $CI_PROJECT_DIR/.cache/pip
dependencies:
- job_test1
before_script:
- mkdir -p "${ORG_DIR}"
- ln -s "${CI_PROJECT_DIR}" "${ORG_DIR}/${PROJECT_NAME}"
- cp bin/* $CI_PROJECT_DIR
- curl -O http://172.16.0.120/testingwork-testing_work.tar.gz
- tar xf testingwork-testing_work.tar.gz
script:
- python -V
- ./ela -v
- cd testingwork-testing_work
- python -m pip install -r requirements.txt
- python dpos_normal_test.py