forked from vmware/splinterdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
steps.lib.yml
155 lines (138 loc) · 3.39 KB
/
steps.lib.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#! Copyright 2018-2021 VMware, Inc.
#! SPDX-License-Identifier: Apache-2.0
---
#@ def get_task_timeout(quick=False, sanitize="", test_nightly=False):
#@ if sanitize:
#@ return "6h"
#@ elif quick:
#@ return "10m"
#@ elif test_nightly:
#@ return "6h"
#@ else:
#@ return "3h"
#@ end
#@ end
#@ def step_build_splinterdb_image(source, compiler):
task: build
timeout: #@ get_task_timeout()
privileged: true
params:
LABEL_git_sha: ((.:git-commit-sha))
config:
platform: linux
image_resource:
type: registry-image
source:
repository: harbor-repo.vmware.com/dockerhub-proxy-cache/concourse/oci-build-task
inputs:
- name: build-env-image-latest
- name: run-env-image-latest
- name: #@ source
path: splinterdb-src
outputs:
- name: image
params:
IMAGE_ARG_build_env_image: build-env-image-latest/image.tar
IMAGE_ARG_run_env_image: run-env-image-latest/image.tar
BUILD_ARG_compiler: #@ compiler
LABEL_compiler: #@ compiler
LABEL_created_by: "SplinterDB Concourse CI"
CONTEXT: splinterdb-src
UNPACK_ROOTFS: true
run:
path: build
#@ end
---
#@ def step_test_with_image():
task: test
timeout: #@ get_task_timeout()
image: image
config:
platform: linux
run:
path: sh
args: ["-c", "cd /splinterdb && ./test.sh"]
params:
INCLUDE_SLOW_TESTS: "true"
#@ end
---
#@ def step_collect_tags(source, compiler):
task: collect-tags
timeout: #@ get_task_timeout()
config:
platform: linux
image_resource:
type: registry-image
source:
repository: harbor-repo.vmware.com/dockerhub-proxy-cache/library/busybox
inputs:
- name: #@ source
path: repo
outputs:
- name: tags
params:
compiler: #@ compiler
run:
path: /bin/sh
args: ['-euc', 'sed -e "s/^/$compiler-/" repo/.git/ref > tags/tags && cat tags/tags']
#@ end
---
#@ def step_build_test(compiler, input_name, is_debug=True, quick=False, sanitize="", test_nightly=False):
task: #@ "debug-build-test" if is_debug else "release-build-test"
timeout: #@ get_task_timeout(quick=quick, sanitize=sanitize, test_nightly=test_nightly)
image: build-env-image-latest
config:
platform: linux
inputs:
- name: #@ input_name
params:
CC: #@ compiler
LD: #@ compiler
INCLUDE_SLOW_TESTS: #@ str(not quick).lower()
RUN_NIGHTLY_TESTS: #@ str(test_nightly).lower()
BUILD_VERBOSE: "1"
VERBOSE: "3"
#! Exercise 'make help' in quick tests mode, to ensure 'help' still works.
MAKE_HELP: #@ "help" if quick else ""
#@ if is_debug:
BUILD_MODE: "debug"
#@ end
#@ if sanitize == "asan":
BUILD_ASAN: "1"
#! work around issue "LeakSanitizer has encountered a fatal error", may be kernel-dependent
ASAN_OPTIONS: "detect_leaks=0"
#@ elif sanitize == "msan":
BUILD_MSAN: "1"
#@ end
run:
path: sh
dir: #@ input_name
args:
- "-c"
- "make $MAKE_HELP all run-tests run-examples"
#@ end
---
#@ def step_set_pr_status(context, branch, status, description=""):
put: update-status
resource: #@ "github-prs-" + branch
params:
path: github-pull-request
status: #@ status
base_context: ci
context: #@ context
#@ if description:
description: #@ status + ": " + description
#@ end
get_params: {skip_download: true}
#@ end
---
#@ def step_set_commit_status(status, context=""):
put: github-commit-status
inputs: [ "source" ]
params:
state: #@ status
#@ if context:
context: #@ context
#@ end
#@ end
---