-
Notifications
You must be signed in to change notification settings - Fork 2
167 lines (138 loc) · 5.17 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
#
# Copyright (c) 2021, RTE (http://www.rte-france.com)
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
name: CI
on:
push:
branches:
- 'main'
- 'release-v**'
pull_request:
defaults:
run:
shell: bash
jobs:
linux:
name: Linux
runs-on: ubuntu-latest
steps:
- name: Install Boost
run: |
sudo apt-get update -y
sudo apt-get install -y libboost-all-dev
- name: Checkout sources
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 #v4.1.6
- name: Configure CMake
run: >
cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build-linux
-DCMAKE_BUILD_TYPE=Release
-DBUILD_EXAMPLES=ON
- name: Build
run: cmake --build $GITHUB_WORKSPACE/build-linux --parallel 3
- name: Tests
run: cmake --build $GITHUB_WORKSPACE/build-linux --target test
env:
CTEST_OUTPUT_ON_FAILURE: 1
macos:
name: MacOS
runs-on: macos-latest
steps:
- name: Install Boost
run: brew install boost
- name: Checkout sources
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 #v4.1.6
- name: Configure CMake
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build-macos -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=ON
- name: Build
run: cmake --build $GITHUB_WORKSPACE/build-macos --parallel 3
- name: Tests
run: cmake --build $GITHUB_WORKSPACE/build-macos --target test
env:
CTEST_OUTPUT_ON_FAILURE: 1
windows:
env:
BOOST_ROOT: C:\thirdparties\boost-1.72.0
BOOST_URL: https://sourceforge.net/projects/boost/files/boost-binaries/1.72.0/boost_1_72_0-msvc-14.2-64.exe/download
LIBXML2_ROOT: C:\thirdparties\libxml2-2.9.10
LIBXML2_URL: https://github.com/GNOME/libxml2/archive/v2.9.10.zip
name: Windows
runs-on: windows-latest
steps:
- name: Install LibXml2
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
choco install wget --no-progress
wget -nv %LIBXML2_URL%
7z x v2.9.10.zip
cd libxml2-2.9.10/win32
cscript configure.js compiler=msvc prefix=%LIBXML2_ROOT% iconv=no
nmake -f Makefile.msvc
nmake -f Makefile.msvc install
- name: Install Boost
shell: cmd
run: |
wget -nv -O boost-installer.exe %BOOST_URL%
boost-installer.exe /dir=%BOOST_ROOT% /sp- /verysilent /suppressmsgboxes /norestart
- name: Checkout sources
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 #v4.1.6
- name: Configure CMake
shell: cmd
run: >
cmake -S %GITHUB_WORKSPACE% -B %GITHUB_WORKSPACE%\build-windows
-DBUILD_EXAMPLES=ON
- name: Build
shell: cmd
run: |
set CL=/MP
cmake --build %GITHUB_WORKSPACE%\build-windows --parallel 3 --config Release
- name: Tests
shell: cmd
run: |
set PATH=%PATH%;%LIBXML2_ROOT%\bin;%BOOST_ROOT%\lib64-msvc-14.2;%GITHUB_WORKSPACE%\build-windows\src\Release;%GITHUB_WORKSPACE%\build-windows\src\test\Release
cmake --build %GITHUB_WORKSPACE%\build-windows --target RUN_TESTS --config Release --verbose
env:
CTEST_OUTPUT_ON_FAILURE: 1
qa:
name: QA
runs-on: ubuntu-latest
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
steps:
- name: Install Java 17
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: '17'
- name: Install gcovr
run: |
sudo apt-get update -y
sudo apt-get install -y gcovr
- name: Install Boost
run: |
sudo apt-get update -y
sudo apt-get install -y libboost-all-dev
- name: Checkout sources
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 #v4.1.6
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@816b1822d71776ee0d32bc012e95024ec52ac1fc # v3.1.0
- name: Build
run: |
cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build -DCMAKE_BUILD_TYPE=Debug -DCODE_COVERAGE=TRUE -DBUILD_EXAMPLES=ON
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build $GITHUB_WORKSPACE/build --parallel 2
- name: Tests
run: >
cmake --build $GITHUB_WORKSPACE/build --target test
env:
CTEST_OUTPUT_ON_FAILURE: 1
- name: Code coverage
run: cmake --build $GITHUB_WORKSPACE/build --target code-coverage
- name: Sonarcloud
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"