-
Notifications
You must be signed in to change notification settings - Fork 38
692 lines (685 loc) · 24.2 KB
/
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
name: Build & Test
on: [push, pull_request]
jobs:
make-release:
name: Publish release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [build-ubuntu, build-macos, build-windows]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download all build artifacts
uses: actions/download-artifact@v2
- name: Create Release
shell: bash
run: |
tag_name="${GITHUB_REF##*/}"
mkdir release
mv $(find . -mindepth 1 -maxdepth 2 -type d -name 'libSMCE-*' -printf '%p/* ') release/
cd release
mkdir hashes
for alg in md5 sha1 sha224 sha256 sha384 sha512; do
"${alg}sum" $(find . -maxdepth 1 -type f | sed 's/.\///') > hashes/$alg.txt
done
mv hashes/* ./
rmdir hashes
hub release create $(find . -type f -printf "-a %p ") -m "libSMCE $tag_name" "$tag_name"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
coverage-linux:
name: libSMCE (coverage) - Linux
runs-on: ubuntu-latest
container: ubuntu:hirsute
env:
DEBIAN_FRONTEND: "noninteractive"
steps:
- uses: actions/checkout@v2
- name: Check deps
run: |
apt-get update
apt-get install -y lcov curl wget git cmake ninja-build g++ libboost-all-dev libmosquitto-dev pkg-config jq perl-base
ninja --version
cmake --version
wget -O Juniper.deb https://www.juniper-lang.org/installers/Juniper-3.0.0.deb
apt-get install ./Juniper.deb
- name: Setup global CMake interceptor
run: ci/setup-cmake-interceptor.sh
- name: CMake configure
run: |
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DSMCE_COVERAGE=On \
-DSMCE_BUILD_STATIC=Off \
-DSMCE_CXXRT_LINKING=SHARED \
-DSMCE_BOOST_LINKING=SHARED \
-DSMCE_MOSQUITTO_LINKING=SHARED \
-DSMCE_TEST_JUNIPER=On \
-B ./build
- name: CMake build
run: cmake --build ./build
- name: Build & Run tests
run: |
cmake --build ./build --target SMCE_Tests
(cd build/test/; ctest --output-on-failure)
- name: Collect C++ coverage information
run: |
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' "${HOME}"'/.cache/*' "$(pwd)/test/*" "$(pwd)/build/*" --output-file coverage.info
lcov --list coverage.info
- name: Collect CMake coverage information
run: |
ci/scan-cmake-commands.sh
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: ./coverage.info,./cmake-codecov-report.json
- name: Upload traces
uses: 'actions/upload-artifact@v2'
with:
name: cmcov-traces
path: CMakeTrace/
debug-cxxstdlib:
name: libSMCE - ${{ matrix.lib }} Debug mode
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- lib: libstdc++
os: ubuntu-latest
c: gcc-10
cxx: g++-10
- lib: libc++
os: ubuntu-latest
c: clang-13
cxx: clang++-13 -stdlib=libc++
env:
CC: ${{ matrix.c }}
CXX: ${{ matrix.cxx }}
steps:
- name: Grab more recent Clang/LLVM
if: matrix.lib == 'libc++'
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
sudo apt-get update && sudo apt-get install -y clang-13 libc++-13-dev libc++abi-13-dev
- uses: actions/checkout@v2
- run: ci/setup-cmake-interceptor.sh
- run: cmake -DSMCE_BUILD_PROFILE=CxxStdLibDebug -S . -B build
- run: cmake --build build/ --target SMCE_Tests
- run: (cd build/test/; ctest --output-on-failure)
- run: ci/scan-cmake-commands.sh
- uses: codecov/codecov-action@v2
with:
files: ./cmake-codecov-report.json
build-ubuntu:
name: libSMCE - Ubuntu (${{ matrix.compiler.name }} & Boost ${{ matrix.boost.version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler:
- name: GCC 10
c: gcc-10
cxx: g++-10
- name: Clang/LLVM 10
c: clang-10
cxx: clang++-10
boost:
- version: 1.74.0
release: true
- version: 1.75.0
release: false
- version: 1.76.0
release: false
- version: 1.77.0
release: false
env:
CC: ${{ matrix.compiler.c }}
CXX: ${{ matrix.compiler.cxx }}
steps:
- uses: actions/checkout@v2
- name: Cache Boost
id: cache-boost
uses: actions/cache@v2
with:
path: boost_root
key: ${{ runner.os }}-boost-${{ matrix.boost.version }}-pic
- name: Install Boost
if: steps.cache-boost.outputs.cache-hit != 'true'
run: ci/build-static-boost.sh ${{ matrix.boost.version }}
- name: Check deps
run: |
sudo apt install ninja-build
ninja --version # technically not a dependency, but used to speedup builds
cmake --version
- name: CMake configure
run: |
export BOOST_ROOT="$(pwd)/boost_root"
mkdir build
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DSMCE_CXXRT_LINKING=STATIC \
-DSMCE_BOOST_LINKING=STATIC \
-DSMCE_OPENSSL_LINKING=STATIC \
-S ./ -B ./build
- name: CMake build
run: cmake --build ./build
- name: Build & Run tests
run: |
cmake --build ./build --target SMCE_Tests
(cd build/test/; ctest --output-on-failure)
- name: Package
run: |
mkdir ./build/packages
(cd build/; cpack -B packages)
rm -rd build/packages/_CPack_Packages
- name: Upload artifacts
if: matrix.boost.release
uses: 'actions/upload-artifact@v2'
with:
name: libSMCE-ubuntu-${{ matrix.compiler.c }}
path: build/packages/*
build-macos:
name: libSMCE - macOS (${{ matrix.compiler.name }})
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
compiler:
- name: GCC 11
release: true
slug: gcc
c: gcc-11
cxx: g++-11
- name: GCC 10
release: false
slug: gcc
c: gcc-10
cxx: g++-10
- name: Clang/LLVM 13
release: true
slug: clang
c: clang-13
cxx: clang++-13
- name: AppleClang 12
release: true
slug: appleclang
c: clang
cxx: clang++
env:
CC: ${{ matrix.compiler.c }}
CXX: ${{ matrix.compiler.cxx }}
steps:
- uses: actions/checkout@v2
- name: Check deps
run: |
brew install ninja openssl bash
ninja --version # technically not a dependency, but used to speedup builds
cmake --version
- name: Cache Boost with GCC
if: startsWith(matrix.compiler.name, 'GCC')
uses: actions/cache@v2
with:
path: |
/usr/local/lib/cmake/Boost
/usr/local/lib/cmake/boost_*
/usr/local/Cellar/boost
key: ${{ runner.os }}-boost176-gcc
- name: Install Boost with GCC
if: startsWith(matrix.compiler.name, 'GCC')
run: |
sed -e 's/bootstrap_args = %W\[/bootstrap_args = %W\[\
--with-toolset=gcc/' -i '' /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/boost.rb
brew install boost -s --cc=${{ matrix.compiler.c }}
brew link boost
- name: Install Boost with Clang
if: (!startsWith(matrix.compiler.name, 'GCC'))
run: brew install boost
- name: Setup global CMake interceptor
run: ci/setup-cmake-interceptor.sh
- name: CMake configure
run: |
[ "${{ matrix.compiler.slug }}" = "clang" ] && export CC="$(brew --prefix llvm)/bin/clang -stdlib=libc++ -nostdinc++ -I/usr/local/opt/llvm/include/c++/v1 -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -Wno-unused-command-line-argument"
[ "${{ matrix.compiler.slug }}" = "clang" ] && export CXX="$(brew --prefix llvm)/bin/clang++ -stdlib=libc++ -nostdinc++ -I/usr/local/opt/llvm/include/c++/v1 -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -Wno-unused-command-line-argument"
mkdir build
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl \
-DSMCE_CXXRT_LINKING=STATIC \
-DSMCE_BOOST_LINKING=STATIC \
-DSMCE_OPENSSL_LINKING=STATIC \
-S ./ -B ./build
- name: CMake build
run: cmake --build ./build
- name: Build & Run tests
run: |
[ "${{ matrix.compiler.slug }}" = "clang" ] && export CC="$(brew --prefix llvm)/bin/clang -stdlib=libc++ -nostdinc++ -I/usr/local/opt/llvm/include/c++/v1 -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -Wno-unused-command-line-argument"
[ "${{ matrix.compiler.slug }}" = "clang" ] && export CXX="$(brew --prefix llvm)/bin/clang++ -stdlib=libc++ -nostdinc++ -I/usr/local/opt/llvm/include/c++/v1 -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -Wno-unused-command-line-argument"
cmake --build ./build --target SMCE_Tests
(cd build/test/; ctest --output-on-failure)
- name: Package
run: |
mkdir ./build/packages
(cd build/; cpack -B packages)
rm -rd build/packages/_CPack_Packages
- name: Upload artifacts
if: matrix.compiler.release
uses: 'actions/upload-artifact@v2'
with:
name: libSMCE-macos-${{ matrix.compiler.slug }}
path: build/packages/*
- name: Collect CMake coverage information
run: ci/scan-cmake-commands.sh
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: ./cmake-codecov-report.json
build-windows:
name: libSMCE - Windows ${{ matrix.build_type }} (${{ matrix.compiler.name }} & Boost ${{ matrix.boost.version }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
build_type: [Debug, Release]
compiler:
- name: MSVC
c: cl
cxx: cl
# - name: Clang/LLVM
# c: clang-cl
# cxx: clang++-cl
boost:
- version: 1.74.0
slug: 1_74_0
vcabi: 14.2
release: false
- version: 1.75.0
slug: 1_75_0
vcabi: 14.2
release: false
- version: 1.76.0
slug: 1_76_0
vcabi: 14.2
release: false
- version: 1.77.0
slug: 1_77_0
vcabi: 14.2
release: false
- version: 1.78.0
slug: 1_78_0
vcabi: 14.3
release: true
# env:
# CC: ${{ matrix.compiler.c }}
# CXX: ${{ matrix.compiler.cxx }}
steps:
- uses: actions/checkout@v2
- run: mkdir C:\local
- name: Cache Boost
id: cache-boost
uses: actions/cache@v2
with:
path: C:\local\boost_${{ matrix.boost.slug }}
key: ${{ runner.os }}-boost-${{ matrix.boost.version }}-64bit
- if: steps.cache-boost.outputs.cache-hit != 'true'
shell: powershell
run: .\ci\install-boost.ps1 '${{ matrix.boost.vcabi }}' '${{ matrix.boost.version }}' '${{ matrix.boost.slug }}'
- name: Check deps
shell: bash
run: |
choco install ninja openssl > silence
ninja --version
- uses: ilammy/msvc-dev-cmd@v1
- name: CMake configure
run: |
mkdir build
cmake -G Ninja `
-DBOOST_ROOT=C:\local\boost_${{ matrix.boost.slug }} `
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} `
-DSMCE_CXXRT_LINKING=SHARED `
-DSMCE_BOOST_LINKING=STATIC `
-DSMCE_OPENSSL_LINKING=STATIC `
-DCPACK_PACKAGE_DIRECTORY=packages `
-S ./ -B ./build
- name: CMake build
run: cmake --build ./build
- name: Build & Run tests
run: |
cmake --build ./build --target SMCE_Tests
cd build/test
ctest --output-on-failure
- name: Package
run: |
mkdir ./build/packages
cd build
cmake --build . --target package
rm -R packages/_CPack_Packages
cd ..
- name: Upload artifacts
if: matrix.boost.release
uses: 'actions/upload-artifact@v2'
with:
name: libSMCE-windows-${{ matrix.compiler.c }}
path: build/packages/*
build-arch:
name: libSMCE - ArchLinux (${{ matrix.compiler.name }})
runs-on: ubuntu-latest
container: archlinux:base-devel
strategy:
fail-fast: false
matrix:
compiler:
- name: GCC
c: gcc
cxx: g++
- name: Clang/LLVM
c: clang
cxx: clang++
env:
CC: ${{ matrix.compiler.c }}
CXX: ${{ matrix.compiler.cxx }}
steps:
- run: cd ~
- uses: actions/checkout@v2
- name: Check deps
run: |
pacman -Syu --noconfirm git cmake boost openssl ninja
if [ "${{ matrix.compiler.c }}" = "clang" ];
then
pacman -Syu --noconfirm clang
fi
ninja --version
- name: CMake configure
run: |
mkdir build
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DSMCE_CXXRT_LINKING=SHARED \
-DSMCE_BOOST_LINKING=STATIC \
-DSMCE_OPENSSL_LINKING=SHARED \
-S ./ -B ./build
- name: CMake build
run: cmake --build ./build
- name: Build & Run tests
run: |
cmake --build ./build --target SMCE_Tests
cd build/test
ctest --output-on-failure
build-fedora:
name: libSMCE - Fedora Rawhide (${{ matrix.compiler.name }})
runs-on: ubuntu-latest
container:
image: fedora:rawhide
options: --security-opt seccomp=unconfined
strategy:
fail-fast: false
matrix:
compiler:
- name: GCC
c: gcc
cxx: g++
pkg: gcc-c++
- name: Clang/LLVM
c: clang
cxx: clang++
pkg: clang
env:
CC: ${{ matrix.compiler.c }}
CXX: ${{ matrix.compiler.cxx }}
steps:
- run: cd ~
- uses: actions/checkout@v2
- name: Check deps
run: |
dnf -y install ${{ matrix.compiler.pkg }} curl git cmake ninja-build boost-devel mosquitto-devel
ninja --version
- name: CMake configure
run: |
cmake -G Ninja \
-DSMCE_BUILD_SHARED=On \
-DSMCE_BUILD_STATIC=On \
-DSMCE_CXXRT_LINKING=SHARED \
-DSMCE_BOOST_LINKING=SHARED \
-DSMCE_ARDRIVO_MQTT=On \
-DSMCE_MOSQUITTO_LINKING=SHARED \
-DSMCE_ARDRIVO_OV767X=On \
-S ./ -B ./build
- name: CMake build
run: cmake --build ./build
- name: Build & Run tests
run: |
cmake --build ./build --target SMCE_Tests
(cd build/test; ctest --output-on-failure)
build-openmandriva:
name: libSMCE - OpenMandriva Lx Cooker (${{ matrix.compiler.name }})
runs-on: ubuntu-latest
container:
image: openmandriva/cooker:latest
options: --security-opt seccomp=unconfined
strategy:
fail-fast: false
matrix:
compiler:
- name: GCC
pkg: gcc-c++
c: gcc
cxx: g++
- name: Clang/LLVM
pkg: clang
c: clang
cxx: clang++
env:
CC: ${{ matrix.compiler.c }}
CXX: ${{ matrix.compiler.cxx }}
steps:
- run: cd ~
- uses: actions/checkout@v2
- name: Check deps
run: |
dnf -y install curl git cmake ninja ${{ matrix.compiler.pkg }} glibc-devel lib64boost-devel lib64openssl-devel
ninja --version
if [[ -f /usr/lib64/librt.so ]]; then
echo "This hotfix is no longer needed" && exit 255
else
ln -s /lib64/librt.so.1 /usr/lib64/librt.so
fi
- name: CMake configure
run: |
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DSMCE_CXXRT_LINKING=SHARED \
-DSMCE_BOOST_LINKING=SHARED \
-DSMCE_OPENSSL_LINKING=SHARED \
-S ./ -B ./build
- name: CMake build
run: cmake --build ./build
- name: Build & Run tests
run: |
cmake --build ./build --target SMCE_Tests
cd build/test
ctest --output-on-failure
package-deb:
name: Package per-distro DEBs (${{ matrix.os.name }} ${{ matrix.os.codename }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- name: Debian
codename: Bookworm
image: debian:bookworm
- name: Debian
codename: Bullseye
image: gcc:11-bullseye
- name: Debian
codename: Buster
image: gcc:10-buster
- name: Ubuntu
codename: Impish
image: ubuntu:impish
- name: Ubuntu
codename: Hirsute
image: ubuntu:hirsute
- name: Ubuntu
codename: Groovy
image: ubuntu:groovy
- name: Ubuntu
codename: Focal
image: ubuntu:focal
container:
image: ${{ matrix.os.image }}
options: --security-opt seccomp=unconfined
env:
DEBIAN_FRONTEND: "noninteractive"
CMAKE_VERSION: 3.21.3
steps:
- name: Setup workdir
run: mkdir /tmp/wk && cd /tmp/wk
- uses: actions/checkout@v2
- name: Fetch deps
id: deps
run: |
apt-get update -y
apt-get install -y file dpkg-dev pkg-config wget # CMake's dpkg-shlibdeps support needs 'file'
apt-get install -y perl jq # For cmcov
git --version || apt-get install -y git
ninja --version || apt-get install -y ninja-build
wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-linux-x86_64.sh
chmod +x cmake-$CMAKE_VERSION-linux-x86_64.sh
./cmake-$CMAKE_VERSION-linux-x86_64.sh --skip-license --prefix=/usr/local
[ "$(g++ --version | grep -oP '\d+' | head -n1)0" -ge 100 ] || ci/install-highest-gcc.sh # GCC 10 required for C++2a
apt-get install -y libssl-dev
if [ $(apt info libboost-dev | grep -oP 'Version: \K\d+\.\d+' | sed -e 's/\.//') -lt '174' ]; then
echo ::set-output name=BUILD_BOOST::true
else
apt-get install -y libboost-dev libboost-atomic-dev libboost-filesystem-dev
echo ::set-output name=BUILD_BOOST::false
fi
- name: Cache Boost
id: cache-boost
if: steps.deps.outputs.BUILD_BOOST == 'true'
uses: actions/cache@v2
with:
path: boost_root
key: ${{ matrix.os.name }}${{ matrix.os.codename }}-boost-1.77.0-static
- name: Install Boost
if: steps.deps.outputs.BUILD_BOOST == 'true' && steps.cache-boost.outputs.cache-hit != 'true'
run: |
apt-get install -y wget
ci/build-static-boost.sh 1.77.0
- name: Setup global CMake interceptor
run: ci/setup-cmake-interceptor.sh
- name: CMake Configure
run: BOOST_ROOT="$(pwd)/boost_root" cmake -G Ninja -DSMCE_BUILD_PROFILE=${{ matrix.os.name }}${{ matrix.os.codename }} -S ./ -B ./build
- name: CMake Build
run: cmake --build ./build
- name: CPack
run: (cd build; cpack)
- name: Test installation
uses: addnab/docker-run-action@v3
with:
image: ${{ matrix.os.image }}
options: -v ${{ github.workspace }}:/host --security-opt seccomp=unconfined
run: |
apt-get update -y
apt-get install -y /host/build/*.deb
- name: Upload artifacts
uses: 'actions/upload-artifact@v2'
with:
name: libSMCE-DEB-${{ matrix.os.name }}${{ matrix.os.codename }}
path: build/*.deb
- name: Collect CMake coverage information
run: ci/scan-cmake-commands.sh
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: ./cmake-codecov-report.json
package-rpm:
name: Package per-distro RPMs (${{ matrix.os.name }} ${{ matrix.os.codename }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- name: Fedora
codename: 33
image: fedora:33
profile: Fedora33
- name: Fedora
codename: 34
image: fedora:34
profile: FedoraHost
- name: Fedora
codename: 35
image: fedora:35
profile: FedoraHost
- name: Fedora
codename: Rawhide
image: fedora:rawhide
profile: FedoraHost
- name: openSUSE
codename: Leap
image: opensuse/leap
profile: OpenSuseLeap
c: gcc-10
cxx: g++-10
- name: OpenMandriva
codename: Lx4.2
image: openmandriva/4.2
profile: FedoraHost
container:
image: ${{ matrix.os.image }}
options: --security-opt seccomp=unconfined
env:
CC: ${{ matrix.os.c }}
CXX: ${{ matrix.os.cxx }}
steps:
- name: Setup workdir
run: mkdir /tmp/wk && cd /tmp/wk
- name: Read Boost version
id: boost-ver
if: matrix.os.name == 'openSUSE'
run: |
echo ::set-output name=SNAKE::$(zypper info boost-devel | grep -oP 'Version\s*: \K\d+\.\d+\.\d+' | sed 's/\./_/g')
- name: Fetch deps
run: |
[[ '${{ matrix.os.name }}' == 'Fedora' ]] && dnf install -y perl jq which tar git cmake rpmdevtools rpmlint ninja-build gcc-c++ boost-devel openssl-devel || true
[[ '${{ matrix.os.name }}' == 'openSUSE' ]] && zypper install -y perl jq which tar git cmake rpmdevtools rpm-build rpmlint ninja gcc10-c++ boost-devel libboost_atomic${{ steps.boost-ver.outputs.SNAKE }}-devel libboost_filesystem${{ steps.boost-ver.outputs.SNAKE }}-devel libopenssl-devel || true
[[ '${{ matrix.os.name }}' == 'OpenMandriva' ]] && dnf install -y perl jq which tar git cmake rpmdevtools rpm-build rpmlint ninja gcc-c++ glibc-devel lib64boost-devel lib64openssl-devel || true
- uses: actions/checkout@v2
- name: Setup global CMake interceptor
run: ci/setup-cmake-interceptor.sh
- name: CMake Configure
run: cmake -G Ninja -DSMCE_BUILD_PROFILE=${{ matrix.os.profile }} -S ./ -B ./build
- name: CMake Build
run: cmake --build ./build
- name: CPack
run: cmake --build ./build --target package
- name: rpmlint
run: rpmlint ./build/*.rpm || true
- name: Test installation
if: matrix.os.name != 'openSUSE'
uses: addnab/docker-run-action@v3
with:
image: ${{ matrix.os.image }}
options: -v ${{ github.workspace }}:/host --security-opt seccomp=unconfined
run: |
[[ '${{ matrix.os.name }}' == 'openSUSE' ]] && zypper install -y dnf rpm-repos-openSUSE || true
dnf install -y /host/build/*.rpm
dnf install -y cmake gcc-c++
[[ '${{ matrix.os.name }}' == 'OpenMandriva' ]] && dnf install -y make glibc-devel || true
cd /host/extra/samples/stduart
CC=gcc CXX=g++ cmake -S . -B build
cmake --build ./build
./build/stduart --help
- name: Upload artifacts
uses: 'actions/upload-artifact@v2'
with:
name: libSMCE-RPM-${{ matrix.os.name }}${{ matrix.os.codename }}
path: build/*.rpm
- name: Collect CMake coverage information
run: ci/scan-cmake-commands.sh
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: ./cmake-codecov-report.json