-
Notifications
You must be signed in to change notification settings - Fork 20
223 lines (221 loc) · 6.5 KB
/
backup-build.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
name: Build and Test All
on:
push:
branches: [ master, test-ready, ]
pull_request:
branches: [ master, test-ready, "bugfix/*" ]
jobs:
build:
runs-on: ubuntu-22.04
env:
ASREPO: ${{ github.workspace }}/server
AWS_SDK_STATIC_PATH: /usr/local/lib
AWS_SDK_CPP_VERSION: 1.10.55
EVENT_LIB: libuv
ZSTD_VERSION: 1.4.9
steps:
- name: install libuv
id: install-libuv
run: |
sudo apt update -y
sudo apt install -y libuv1-dev
- name: install lcov
id: install-lcov
run: |
sudo apt install -y lcov
- name: install Valgrind
id: install-valgrind
run: |
sudo apt install -y valgrind
- name: install secret agent client requirements
id: install-secret-agent-client-requirements
run: |
sudo apt install -y libjansson-dev
- name: install AWS requirements
id: install-aws-requirements
run: |
sudo apt install -y libcurl4-openssl-dev libssl-dev uuid-dev zlib1g-dev libpulse-dev
- name: Cache AWS C++ sdk
id: cache-aws-sdk-cpp
uses: actions/cache@v3
env:
cache-name: aws-sdk-cpp
with:
path: aws-sdk-cpp
key: aws-sdk-cpp-build-and-test-${{ env.AWS_SDK_CPP_VERSION }}-${{ runner.os }}
- name: Download AWS C++ sdk
uses: actions/checkout@v3
if: steps.cache-aws-sdk-cpp.outputs.cache-hit != 'true'
with:
repository: aws/aws-sdk-cpp
submodules: recursive
ref: ${{ env.AWS_SDK_CPP_VERSION }}
path: aws-sdk-cpp
- name: Build AWS C++ sdk
if: steps.cache-aws-sdk-cpp.outputs.cache-hit != 'true'
run: |
mkdir aws-sdk-cpp/build
cd aws-sdk-cpp/build
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_ONLY="s3" -DBUILD_SHARED_LIBS=OFF -DENABLE_TESTING=OFF -DCMAKE_PREFIX_PATH=/usr/local -DCMAKE_INSTALL_LIBDIR=lib
make
- name: Install AWS C++ sdk
run: |
cd aws-sdk-cpp/build
sudo make install
- name: Download zstd
uses: actions/checkout@v3
with:
repository: facebook/zstd
submodules: recursive
ref: v${{ env.ZSTD_VERSION }}
path: zstd-${{ env.ZSTD_VERSION }}
- name: Cache zstd
id: cache-zstd
uses: actions/cache@v3
env:
cache-name: zstd
with:
path: zstd-${{ env.ZSTD_VERSION }}
key: zstd-${{ env.ZSTD_VERSION }}-${{ runner.os }}
- name: Build zstd
id: build-zstd
if: steps.cache-zstd.outputs.cache-hit != 'true'
run: |
cd zstd-${{ env.ZSTD_VERSION }}
make
- name: install zstd
run: |
cd zstd-${{ env.ZSTD_VERSION }}
sudo make install
- name: Download libcheck
uses: dsaltares/[email protected]
with:
repo: "libcheck/check"
version: "tags/0.15.2"
file: check-0.15.2.tar.gz
- name: Cache libcheck
id: cache-libcheck
uses: actions/cache@v3
env:
cache-name: libcheck
with:
path: check-0.15.2
key: check-0.15.2-${{ runner.os }}
- name: Build libcheck
id: build-libcheck
if: steps.cache-libcheck.outputs.cache-hit != 'true'
run: |
tar xvfz check-0.15.2.tar.gz && cd check-0.15.2
./configure
make
- name: install libcheck
run: |
cd check-0.15.2
sudo make install
sudo ldconfig
- name: Checkout c client
uses: actions/checkout@v3
with:
repository: aerospike/aerospike-client-c
submodules: recursive
ref: 6.0.0
path: client
- name: Build client lib
run: make
working-directory: client
- name: Checkout asbackup
uses: actions/checkout@v3
with:
path: main
submodules: recursive
- name: Info
run: make info
working-directory: main
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Initialize codecov
run: make coverage-init
working-directory: main
- name: Unit Test
run: make unit
working-directory: main
# - name: Set cores to get stored in /cores
# run: |
# sudo mkdir /cores
# sudo chmod 777 /cores
# # Core filenames will be of the form executable.pid.timestamp:
# sudo bash -c 'echo "/cores/%e.%p.%t" > /proc/sys/kernel/core_pattern'
- name: Test secret agent
run: |
make run_test_secrets
working-directory: main
- name: Test secrets
run: |
make run_test_secret_agent
working-directory: main
# - name: Enable core directories
# if: fails()
# run: sudo chmod -R +rwx /cores/* # Enable access to core dumps (doesn't need to be in same run block)
# - name: Setup tmate session
# if: fails()
# uses: mxschmitt/action-tmate@v3
# - uses: actions/upload-artifact@master # capture all crashes as build artifacts
# if: fails()
# with:
# name: crashes
# path: /cores
- name: Test Validate
run: make run_test_validate
working-directory: main
- name: Test Bin Name
run: make run_test_bin_name
working-directory: main
- name: Test asbackup/asrestore with Valgrind
run: make run_test_w_valgrind
working-directory: main
- name: Test Set Name
run: make run_test_set_name
working-directory: main
- name: Test Key
run: make run_test_key
working-directory: main
- name: Test Value
run: make run_test_value
working-directory: main
- name: Test Index
run: make run_test_index
working-directory: main
- name: Test UDF
run: make run_test_udf
working-directory: main
- name: Test TTL
run: make run_test_ttl
working-directory: main
- name: Test Policy
run: make run_test_policy
working-directory: main
- name: Test Filter
run: make run_test_filter
working-directory: main
- name: Test Resume
run: make run_test_resume
working-directory: main
- name: Test S3
run: make run_test_s3
working-directory: main
- name: Accumulate coverage
run: make coverage
working-directory: main
- name: Report coverage
run: make report
working-directory: main
- name: clear temp directories
run: |
rm -rf client
rm -rf main/target
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
verbose: false
directory: main/test_target
files: main/test_target/aerospike-tools-backup.info