-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
63 lines (57 loc) · 1.42 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
variables:
GIT_STRATEGY: fetch
GIT_SUBMODULE_STRATEGY: recursive
DOCKER_FILE: tests/Dockerfile
DOCKER_TAG: ${CI_COMMIT_REF_NAME}
DOCKER_IMAGE_DEV: rpclib
stages:
- prepare
- test
# Build docker image
prepare:centos8:docker-dev:
stage: prepare
script:
- docker build
--file ${DOCKER_FILE}
--tag ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
--tag ${DOCKER_IMAGE_DEV}:latest .
tags:
- docker
test:fmt:
needs: ["prepare:centos8:docker-dev"]
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
script:
- cargo fmt -- --check
tags:
- docker
test:clippy:
needs: ["prepare:centos8:docker-dev"]
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
script:
- cargo clippy -- -D warnings
tags:
- docker
# Parser Unit-Tests
test:unit:
needs: ["prepare:centos8:docker-dev"]
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
script:
- cargo test --package rpc-lib-derive
tags:
- docker
# Rpc-Lib Integration Tests
test:integration:
stage: test
needs: ["prepare:centos8:docker-dev"]
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
script:
- rpcbind
- cd tests/server/ && mkdir gen && cd gen && cp ../../test.x .
- rpcgen -N test.x -a && rm -f Makefile.test && rm -f test_server.c && mv ../Makefile . && mv ../test_server.c .
- make test_server && mv test_server .. && cd ..
- ./test_server &
- sleep 1 && rpcinfo
- cd ../..
- cargo test --tests
tags:
- docker