-
Notifications
You must be signed in to change notification settings - Fork 13
181 lines (154 loc) · 6.54 KB
/
main.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
name: Inter-Process Communication (IPC) pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
ipc_pipeline:
strategy:
fail-fast: false
matrix:
compiler:
- { id: gcc-9, name: gcc, version: 9, c-path: /usr/bin/gcc-9, cpp-path: /usr/bin/g++-9 }
- { id: gcc-10, name: gcc, version: 10, c-path: /usr/bin/gcc-10, cpp-path: /usr/bin/g++-10 }
- { id: gcc-11, name: gcc, version: 11, c-path: /usr/bin/gcc-11, cpp-path: /usr/bin/g++-11 }
- { id: gcc-13, name: gcc, version: 13, c-path: /usr/bin/gcc-13, cpp-path: /usr/bin/g++-13 }
- { id: clang-13, name: clang, version: 13, c-path: /usr/bin/clang-13, cpp-path: /usr/bin/clang++-13 }
- { id: clang-15, name: clang, version: 15, c-path: /usr/bin/clang-15, cpp-path: /usr/bin/clang++-15 }
- { id: clang-16, name: clang, version: 16, c-path: /usr/bin/clang-16, cpp-path: /usr/bin/clang++-16, install: True }
- { id: clang-17, name: clang, version: 17, c-path: /usr/bin/clang-17, cpp-path: /usr/bin/clang++-17, install: True }
build-type:
- { id: debug, conan-name: Debug, conan-jemalloc: Debug, conan-preset: debug }
- { id: release, conan-name: Release, conan-jemalloc: Release, conan-preset: release }
- { id: relwithdebinfo, conan-name: RelWithDebInfo, conan-jemalloc: Release, conan-preset: relwithdebinfo }
- { id: minsizerel, conan-name: MinSizeRel, conan-jemalloc: Release, conan-preset: minsizerel}
runs-on: ubuntu-latest
name: |
${{ matrix.compiler.id }}-${{ matrix.build-type.id }}
steps:
- name: Update available software list for apt-get
run: sudo apt-get update
- name: Checkout IPC repository and submodules like flow
uses: actions/checkout@v4
with:
submodules: true
- name: Install clang compiler
run: |
wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh ${{ matrix.compiler.version }}
if: |
matrix.compiler.install && matrix.compiler.name == 'clang'
- name: Install GCC compiler
run: |
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update
sudo apt-get install -y gcc-${{ matrix.compiler.version }} g++-${{ matrix.compiler.version }}
if: |
matrix.compiler.install && matrix.compiler.name == 'gcc'
- name: Install IPC dependencies with apt-get
run: |
sudo apt-get install -y graphviz
- name: Install conan
run: |
pip install "conan<2"
- name: Create conan profile
run: |
cat <<EOF > conan_profile
[settings]
compiler = ${{ matrix.compiler.name }}
compiler.version = ${{ matrix.compiler.version }}
compiler.cppstd = 17
compiler.libcxx = libstdc++11
arch = x86_64
os = Linux
build_type = ${{ matrix.build-type.conan-name }}
jemalloc:build_type = ${{ matrix.build-type.conan-jemalloc }}
[conf]
tools.build:compiler_executables = {"c": "${{ matrix.compiler.c-path }}", "cpp": "${{ matrix.compiler.cpp-path }}"}
tools.env.virtualenv:auto_use = True
[options]
jemalloc:enable_cxx = False
jemalloc:prefix = je_
[buildenv]
CC = ${{ matrix.compiler.c-path }}
CXX = ${{ matrix.compiler.cpp-path }}
EOF
- name: Install IPC dependencies with conan using the profile
run: |
conan editable add flow flow/1.0
conan install \
. \
--profile:build=conan_profile \
--profile:host=conan_profile \
--build=missing
- name: Get the number of CPU cores for parallelization like the build process
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: Prepare makefile
run: |
cmake \
--preset ${{ matrix.build-type.conan-preset }} \
-DCFG_ENABLE_DOC_GEN=ON \
-DCFG_ENABLE_TEST_SUITE=ON \
-DJEMALLOC_PREFIX=je_ \
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/build/${{ matrix.build-type.conan-name }}/install
- name: Build targets like unit tests with makefile
run: |
VERBOSE=1 make \
--keep-going \
--directory $GITHUB_WORKSPACE/build/${{ matrix.build-type.conan-name }} \
-j${{ steps.cpu-cores.outputs.count }}
- name: Install targets with makefile
run: |
VERBOSE=1 make install \
--directory $GITHUB_WORKSPACE/build/${{ matrix.build-type.conan-name }} \
-j${{ steps.cpu-cores.outputs.count }}
- name: Run unit tests
run: |
cd $GITHUB_WORKSPACE/build/${{ matrix.build-type.conan-name }}/install/bin
./libipc_unit_test.exec
- name: Run core link test
run: |
cd $GITHUB_WORKSPACE/build/${{ matrix.build-type.conan-name }}/install/bin
./ipc_core_link_test.exec
- name: Run structured transport link test
run: |
cd $GITHUB_WORKSPACE/build/${{ matrix.build-type.conan-name }}/install/bin
./ipc_transport_structured_link_test.exec
- name: Run session link test
run: |
cd $GITHUB_WORKSPACE/build/${{ matrix.build-type.conan-name }}/install/bin
./ipc_session_link_test_srv.exec &
sleep 1
./ipc_session_link_test_cli.exec
- name: Run shared memory link test
run: |
cd $GITHUB_WORKSPACE/build/${{ matrix.build-type.conan-name }}/install/bin
./ipc_shm_link_test_srv.exec &
sleep 1
./ipc_shm_link_test_cli.exec
- name: Run SHM-jemalloc link test
run: |
cd $GITHUB_WORKSPACE/build/${{ matrix.build-type.conan-name }}/install/bin
./ipc_shm_arena_lend_link_test_srv.exec &
sleep 1
./ipc_shm_arena_lend_link_test_cli.exec
- name: Create doxygen documentation with makefile
run: |
VERBOSE=1 make \
--directory $GITHUB_WORKSPACE/build/${{ matrix.build-type.conan-name }} \
-j${{ steps.cpu-cores.outputs.count }} \
ipc_doc_public \
ipc_doc_full
- name: Upload doxygen documentation
uses: actions/upload-artifact@v3
with:
name: doxygen-doc-${{ matrix.compiler.id }}-${{ matrix.build-type.id }}
path: |
${{ github.workspace }}/build/${{ matrix.build-type.conan-name }}/html_ipc_doc_public/**/*
${{ github.workspace }}/build/${{ matrix.build-type.conan-name }}/html_ipc_doc_full/**/*