-
Notifications
You must be signed in to change notification settings - Fork 127
142 lines (121 loc) · 4.37 KB
/
centos-latest.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
name: Build & Test on CentOS Latest
on: [push, pull_request]
concurrency:
group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
container:
image: centos:latest
strategy:
matrix:
os: [ubuntu-20.04]
etcd: [v3.4.13]
steps:
- name: Install dependencies for Linux
run: |
# switch to centos stream
dnf -y --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos
dnf -y update
# install required dependencies
yum -y group install "Development Tools"
yum -y install boost-devel \
cmake \
git \
openssl-devel \
wget
# install screen fetch
wget -O screenfetch-dev https://git.io/vaHfR
chmod +x screenfetch-dev
mv ./screenfetch-dev /usr/bin/screenfetch
# the checkout action require new version of git
- uses: actions/checkout@v3
with:
submodules: true
- name: Cache for cccahe
uses: actions/cache@v3
with:
path: /home/runner/.ccache
key: ${{ runner.os }}-centos-ccache-${{ hashFiles('/CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-centos-ccache-
- name: Install grpc v1.27.x for CentOS latest
run: |
# We simply keep the same version with Ubuntu 18.04
#
git clone https://github.com/grpc/grpc.git --depth 1 --branch v1.27.x
cd grpc/
git submodule update --init
mkdir cmake-build
cd cmake-build/
cmake .. -DBUILD_SHARED_LIBS=ON \
-DgRPC_INSTALL=ON \
-DgRPC_BUILD_TESTS=OFF \
-DgRPC_BUILD_CSHARP_EXT=OFF \
-DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF \
-DgRPC_BACKWARDS_COMPATIBILITY_MODE=ON \
-DgRPC_ZLIB_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package
make -j`nproc`
make install
- name: Screen fetch
run: |
screenfetch
- name: Install etcd for Linux
run: |
# install etcd
wget https://github.com/etcd-io/etcd/releases/download/${{ matrix.etcd }}/etcd-${{ matrix.etcd }}-linux-amd64.tar.gz
tar zxvf etcd-${{ matrix.etcd }}-linux-amd64.tar.gz
mv etcd-${{ matrix.etcd }}-linux-amd64/etcd /usr/local/bin/
mv etcd-${{ matrix.etcd }}-linux-amd64/etcdctl /usr/local/bin/
- name: Install cpprestsdk
run: |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/local/lib64
mkdir -p build
cd build
git clone https://github.com/microsoft/cpprestsdk.git --depth=1
mkdir -p cpprestsdk/build
cd cpprestsdk/build
cmake .. -DCMAKE_BUILD_TYPE=Debug \
-DBUILD_TESTS=OFF \
-DBUILD_SAMPLES=OFF \
-DCPPREST_EXCLUDE_WEBSOCKETS=ON
make -j`nproc`
make install
- name: Build
run: |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/local/lib64
mkdir -p build
cd build
cmake .. -DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD_REQUIRED=TRUE \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_ETCD_TESTS=ON
make -j`nproc`
make install
- name: Setup tmate session
if: false
uses: mxschmitt/action-tmate@v3
- name: Test
run: |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/local/lib64
# use etcd v3 api
export ETCDCTL_API="3"
rm -rf default.etcd
/usr/local/bin/etcd &
sleep 5
# tests without auth
./build/bin/EtcdSyncTest
./build/bin/EtcdTest
./build/bin/LockTest
./build/bin/MemLeakTest
./build/bin/WatcherTest
./build/bin/ElectionTest
killall -TERM etcd
sleep 5