This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
113 lines (104 loc) · 3.03 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
include:
- local: namib_controller/.gitlab-ci.yml
- local: namib_enforcer/.gitlab-ci.yml
- local: namib_shared/.gitlab-ci.yml
- local: .common.yml
stages:
- build
- test
- package
- image
- docs
- release
variables:
# Kubernetes Runner Resource Limiting
KUBERNETES_CPU_REQUEST: 4
# KUBERNETES_CPU_LIMIT: 5
KUBERNETES_MEMORY_REQUEST: 4Gi
KUBERNETES_MEMORY_LIMIT: 4Gi
# KUBERNETES_SERVICE_CPU_REQUEST: 400m
# KUBERNETES_SERVICE_CPU_LIMIT: 400m
# KUBERNETES_SERVICE_MEMORY_REQUEST: 1Gi
# KUBERNETES_SERVICE_MEMORY_LIMIT: 1Gi
# ---
# Cargo Settings
# Number of concurrent build threads to start.
# Note: Removing this value somehow causes jobs to randomly get stuck during compilation.
CARGO_BUILD_JOBS: 4
# Location of Cargo home. Needed for caching.
CARGO_HOME: "${CI_PROJECT_DIR}/.cargo"
# ---
# Fastzip
# Use faster cache and artifact compression method.
# Increases speed **drastically**, so don't remove it unless it causes issues.
FF_USE_FASTZIP: "true"
CACHE_COMPRESSION_LEVEL: fast
TRANSFER_METER_FREQUENCY: 5s
# No longer create push pipeline if MR is created (avoiding duplicate pipelines).
# See https://docs.gitlab.com/ee/ci/yaml/workflow.html#switch-between-branch-pipelines-and-merge-request-pipelines
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
when: never
- if: '$CI_COMMIT_BRANCH'
# Default image for all builds is the generic controller project build image containing most
# external dependencies, including rust, clippy, cargo, and C library dependencies.
# Adding additional dependencies to this image (by opening a MR in the respective project)
# is strongly preferred to installing dependencies in before_script.
image: gitlab.informatik.uni-bremen.de:5005/namib-master/ci-docker-images/controller:generic
default:
# Use the shared linux Kubernetes cluster for most tasks.
tags:
- linux
- docker
- kubernetes
# We don't want to keep most artifacts around for longer.
artifacts:
expire_in: 1 week
# retry: 2
fetch-deps:
stage: .pre
cache:
- key: !reference [.pkg_cache, key]
paths: !reference [.pkg_cache, paths]
policy: pull-push
script:
- cargo fetch --locked
docs:
stage: docs
rules:
- !reference [.on_default_branch]
- !reference [.on_tags]
- !reference [.allow_manual_run]
variables:
DATABASE_URL: sqlite:/tmp/db.sqlite
before_script:
- ./namib_controller/scripts/recreate_db.sh
script:
- cargo doc --workspace --no-deps
artifacts:
paths:
- target/doc
pages:
stage: release
needs:
- docs
rules:
- !reference [.on_default_branch]
script:
- mv target/doc public
- echo '<meta http-equiv="refresh" content="0; url="namib_controller/index.html">' > public/index.html
artifacts:
paths:
- public
gen-lsif:
stage: .post
allow_failure: true
cache: []
needs: []
script:
- rust-analyzer lsif . > controller.lsif
artifacts:
reports:
lsif: controller.lsif