-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (65 loc) · 2.42 KB
/
ci.yml
File metadata and controls
73 lines (65 loc) · 2.42 KB
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
name: CI
on: [push, pull_request]
jobs:
tests:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
BUILDTYPE: ["Debug", "Release"]
include:
- os: "ubuntu-latest"
cppstd: "20"
cc: clang
cxx: clang++
- os: "ubuntu-latest"
cppstd: "23"
cc: clang
cxx: clang++
- os: "ubuntu-latest"
cppstd: "20"
cc: gcc
cxx: g++
- os: "ubuntu-latest"
cppstd: "23"
cc: gcc
cxx: g++
- os: "ubuntu-latest"
cppstd: "20"
deps: "lcov"
coverage: "-DCOVERAGE=ON"
- os: "windows-latest"
cppstd: "20"
cc: "msbuild"
cxx: "msbuild"
steps:
- uses: actions/checkout@v3
- name: install_ubuntu_deps
env:
FILE_ONE: ${{ secrets.KRM_MAIN_FILE }}
FILE_TWO: ${{ secrets.KRM_SCND_FILE }}
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get install libgtest-dev openssl clang-tidy && cd /usr/src/gtest && sudo cmake CMakeLists.txt && sudo make && sudo cp lib/*.a /usr/lib && sudo ln -s /usr/lib/libgtest.a /usr/local/lib/libgtest.a && sudo ln -s /usr/lib/libgtest_main.a /usr/local/lib/libgtest_main.a |
echo "${FILE_ONE}" | base64 --decode > ${HOME}/key.pem |
echo "${FILE_TWO}" | base64 --decode > ${HOME}/scert.crt
- name: install_windows_deps
if: ${{ matrix.os == 'windows-latest' }}
env:
FILE_ONE: ${{ secrets.KRM_WIN_MAIN_FILE }}
FILE_TWO: ${{ secrets.KRM_WIN_SCND_FILE }}
run: |
echo "${FILE_ONE}" | openssl base64 -d > ${HOME}/privatekey.key |
echo "${FILE_TWO}" | openssl base64 -d > ${HOME}/certificate.crt |
choco install openssl
- name: windows_uses
if: ${{ matrix.os == 'windows-latest' }}
uses: MarkusJx/googletest-installer@v1.1.1
- name: build
run: |
cmake . -B ${{github.workspace}}/build -DCMAKE_C_COMPILER=${{ matrix.cc }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_BUILD_TYPE=${{ matrix.BUILDTYPE }} \
-DCMAKE_CXX_STANDARD=${{ matrix.cppstd }}
cmake --build ${{github.workspace}}/build --config ${{ matrix.BUILDTYPE }}
- name: test
run: ctest -VV --test-dir ${{github.workspace}}/build -C ${{ matrix.BUILDTYPE}}