-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
111 lines (100 loc) · 1.87 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
# CI configuration.
stages:
- docker
- checks
- reports
- publish
# build and push docker image. this contains a rust compiler as well as some tooling
# (cargo llvm-cov, cargo hack) used for testing and coverage reporting.
docker:
stage: docker
image: docker
services:
- docker:dind
script:
- docker build . -t "$CI_REGISTRY_IMAGE"
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
- docker push "$CI_REGISTRY_IMAGE"
interruptible: true
only:
refs:
- main
changes:
- Dockerfile
# run unit tests
test:
stage: checks
image: $CI_REGISTRY_IMAGE
interruptible: true
script:
- just test
# check all feature combinations
features:
stage: checks
image: $CI_REGISTRY_IMAGE
interruptible: true
script:
- just features
# run cargo clippy
style:
stage: checks
image: $CI_REGISTRY_IMAGE
interruptible: true
script:
- just style
# run unit tests
test:book:
stage: checks
image: $CI_REGISTRY_IMAGE
interruptible: true
script:
- just book-test
# build documentation
docs:
stage: reports
image: $CI_REGISTRY_IMAGE
interruptible: true
script:
- just docs
artifacts:
expire_in: 1 week
paths:
- target/doc
# build book
book:
stage: reports
image: $CI_REGISTRY_IMAGE
interruptible: true
script:
- just book-build
artifacts:
expire_in: 1 week
paths:
- target/book
# build coverage.
coverage:
stage: reports
image: $CI_REGISTRY_IMAGE
interruptible: true
script:
- just coverage
artifacts:
expire_in: 1 week
paths:
- target/llvm-cov/html
pages:
stage: publish
image: alpine
dependencies:
- docs
- coverage
- book
script:
- mv target/book public
- mv target/doc public/rustdoc
- mv target/llvm-cov/html public/coverage
artifacts:
paths:
- public
only:
- main