-
Notifications
You must be signed in to change notification settings - Fork 757
195 lines (181 loc) · 5.64 KB
/
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
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
name: CI
on: [push, pull_request]
defaults:
run:
shell: bash
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
cppstd: ["98", "11", "20"]
cc: ["gcc-10"]
cxx: ["g++-10"]
drafts: ["ON"]
libzmq: ["4.3.4"]
libzmqbuild: ["cmake"]
include:
# older libzmq and gcc without draft
- os: "ubuntu-18.04"
cppstd: "11"
cc: "gcc-7"
cxx: "g++-7"
drafts: "OFF"
libzmq: "4.2.0"
libzmqbuild: "pkgconfig"
# gcc 4.8
- os: "ubuntu-18.04"
cppstd: "11"
cc: "gcc-4.8"
cxx: "g++-4.8"
drafts: "ON"
libzmq: "4.3.4"
libzmqbuild: "cmake"
aptinstall: "gcc-4.8 g++-4.8"
# gcc 5
- os: "ubuntu-18.04"
cppstd: "11"
cc: "gcc-5"
cxx: "g++-5"
drafts: "ON"
libzmq: "4.3.4"
libzmqbuild: "cmake"
aptinstall: "gcc-5 g++-5"
# without draft
- os: "ubuntu-latest"
cppstd: "20"
cc: "gcc-10"
cxx: "g++-10"
drafts: "OFF"
libzmq: "4.3.4"
libzmqbuild: "cmake"
# coverage (gcc version should match gcov version)
- os: "ubuntu-latest"
cppstd: "17"
cc: "gcc-9"
cxx: "g++-9"
drafts: "ON"
libzmq: "4.3.4"
libzmqbuild: "cmake"
coverage: "-DCOVERAGE=ON"
aptinstall: "lcov"
# clang
- os: "ubuntu-latest"
cppstd: "17"
cc: "clang-12"
cxx: "clang++-12"
drafts: "ON"
libzmq: "4.3.4"
libzmqbuild: "cmake"
# macos
- os: "macos-latest"
cppstd: "17"
cc: "clang"
cxx: "clang++"
drafts: "OFF"
libzmq: "4.3.4"
libzmqbuild: false
brewinstall: "zeromq"
# windows
- os: "windows-2019"
cppstd: "14"
cc: "msbuild"
cxx: "msbuild"
drafts: "ON"
libzmq: "4.3.4"
libzmqbuild: "cmake"
platform: "-Ax64"
- os: "windows-latest"
cppstd: "20"
cc: "msbuild"
cxx: "msbuild"
drafts: "ON"
libzmq: "4.3.4"
libzmqbuild: "cmake"
platform: "-Ax64"
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
VERBOSE: 1
THREADS: 2
BUILDTYPE: "Debug"
steps:
- uses: actions/checkout@v2
- name: install_deps
run: |
if [ ! -z "${{ matrix.aptinstall }}" ]; then
sudo apt install -y ${{ matrix.aptinstall }}
fi
if [ ! -z "${{ matrix.brewinstall }}" ]; then
brew install ${{ matrix.brewinstall }}
fi
- name: get_libzmq
run: |
curl -L https://github.com/zeromq/libzmq/archive/v${{ matrix.libzmq }}.tar.gz \
>zeromq.tar.gz
tar -xvzf zeromq.tar.gz
- name: build_libzmq_cmake
if: ${{ matrix.libzmqbuild == 'cmake' }}
run: |
cmake -Hlibzmq-${{ matrix.libzmq }} -Blibzmq-build ${{ matrix.platform}} \
-DWITH_PERF_TOOL=OFF \
-DZMQ_BUILD_TESTS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_DRAFTS=${{ matrix.drafts }}
cmake --build libzmq-build --config ${BUILDTYPE} -j ${THREADS}
echo "LIBZMQ=${PWD}/libzmq-build" >> ${GITHUB_ENV}
- name: build_libzmq_pkgconfig
if: ${{ matrix.libzmqbuild == 'pkgconfig' }}
working-directory: libzmq-${{ matrix.libzmq }}
run: |
./autogen.sh &&
./configure --prefix=${PWD}/libzmq-build &&
make -j ${THREADS}
make install
echo "LIBZMQ=${PWD}/libzmq-build" >> ${GITHUB_ENV}
- name: build
env:
CMAKE_PREFIX_PATH: ${{ env.LIBZMQ }}
run: |
cmake -H. -Bbuild ${{ matrix.platform}} ${{ matrix.coverage }} \
-DCMAKE_BUILD_TYPE=${BUILDTYPE} \
-DENABLE_DRAFTS=${{ matrix.drafts }} \
-DCMAKE_CXX_STANDARD=${{ matrix.cppstd }}
cmake --build build --config ${BUILDTYPE} -j ${THREADS}
echo "CPPZMQ=${PWD}/build" >> ${GITHUB_ENV}
- name: test
# for unknown reason no tests are found and run on windows
# could be something to do with catch_discover_tests not working?
run: |
cd ${{ env.CPPZMQ }}
ctest -V -C ${BUILDTYPE}
- name: demo
# probably need to install libzmq and cppzmq for this to work on windows
if: ${{ matrix.os == 'ubuntu*' }}
env:
CMAKE_PREFIX_PATH: ${{ env.LIBZMQ }}:${{ env.CPPZMQ }}
run: |
cd demo
cmake -H. -Bbuild ${{ matrix.platform}} \
-DCMAKE_BUILD_TYPE=${BUILDTYPE} \
-DCMAKE_CXX_STANDARD=${{ matrix.cppstd }}
cmake --build build --config ${BUILDTYPE}
cd build
ctest -V -C ${BUILDTYPE}
- name: lcov
if: ${{ matrix.coverage && success() }}
run: |
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info -o coverage_filtered.info \
'/usr/include/*' \
'/usr/local/include/*' \
${PWD}'/tests/*' \
${PWD}'/build/*'
# to generate local html: genhtml coverage_filtered.info --output-directory .
- name: coveralls_upload
if: ${{ matrix.coverage && success() }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage_filtered.info