-
Notifications
You must be signed in to change notification settings - Fork 8
121 lines (100 loc) · 3.51 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
name: CI
on:
push:
pull_request:
release:
types: [published]
jobs:
ci:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
name:
[ubuntu-gcc-10, ubuntu-clang-12, macos-appleclang-12, windows-msvc-19, windows-clang]
include:
- name: ubuntu-gcc-10
os: ubuntu-22.0
compiler: g++-10
configurePreset: ci-ninja-debug
- name: ubuntu-clang-12
os: ubuntu-22.0
compiler: clang++-12
configurePreset: ci-ninja-debug
- name: macos-appleclang-12
os: macos-10.15
configurePreset: ci-ninja-debug
- name: windows-msvc-19
os: windows-2019
configurePreset: ci-msvc-19
buildPreset: ci-msvc-debug
testPreset: ci-unit-tests-debug
- name: windows-clang
os: windows-2019
configurePreset: ci-ninja-windows-debug
steps:
- uses: actions/checkout@v1
- name: install-python-3
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: install-python-deps
run: |
python3 -m pip install --upgrade pip
pip3 install pytest pytest-depends conan cpplint
- name: set-compiler-env
run: |
if [ "${{ matrix.compiler }}" != "" ]; then
echo "CXX=${{ matrix.compiler }}" >> $GITHUB_ENV
fi
cmake --version
shell: bash
- name: dependecies (macos)
if: runner.os == 'macOS'
# macOS is using libreSSL which clashes with openssl which means that the package is extracted but
# not installed properly in the system. Because of this cmake needs to be pointed to the correct place
run: |
brew update
brew extract --version=1.2021.13 plantuml homebrew/cask
brew install [email protected] [email protected] ninja clang-format llvm
brew install --cask doxygen
ln -s "/usr/local/opt/llvm/bin/clang-tidy" "/usr/local/bin/clang-tidy"
echo "OPENSSL_ROOT_DIR=/usr/local/opt/[email protected]/" >> $GITHUB_ENV
- name: dependencies (windows)
if: runner.os == 'Windows'
run: |
choco install -y --limit-output plantuml ninja opencppcoverage
choco install -y --limit-output doxygen.install --version="1.9.2"
- name: dependencies (debian-like)
if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'debian')
run: |
sudo apt -y update
sudo apt -y install doxygen plantuml gcovr ninja-build cppcheck clang-tidy iwyu ccache
- name: correct-tmp-dir (win)
if: runner.os == 'Windows'
run: |
echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
echo "TMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
shell: pwsh
- name: cmake-configure
run: |
cmake --preset=${{ matrix.configurePreset }}
- name: build
run: |
if [ "${{ matrix.buildPreset }}" == "" ]; then
cmake --build ./build
else
cmake --build --preset=${{ matrix.buildPreset }}
fi
shell: bash
- name: ctest
run: |
if [ "${{ matrix.testPreset }}" == "" ]; then
ctest --test-dir build
else
ctest --preset=${{ matrix.testPreset }}
fi
shell: bash
- name: pytest
run: python3 -m pytest -x -v