-
Notifications
You must be signed in to change notification settings - Fork 2
186 lines (156 loc) · 5.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
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
#
# 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@v1
- 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@v1
- 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@v1
- 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
steps:
- name: Install Java 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Install gcovr
run: |
sudo apt-get update -y
sudo apt-get install -y gcovr
- name: Install Sonar wrapper
working-directory: ${{ runner.workspace }}
run: |
wget https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
unzip build-wrapper-linux-x86.zip
- name: Install Sonar scanner
working-directory: ${{ runner.workspace }}
run: |
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip
unzip sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip
ln -s sonar-scanner-${SONAR_SCANNER_VERSION} sonar
rm sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip
env:
SONAR_SCANNER_VERSION: 3.3.0.1492
- name: Install Boost
run: |
sudo apt-get update -y
sudo apt-get install -y libboost-all-dev
- name: Checkout sources
uses: actions/checkout@v1
- name: Configure CMake
run: >
cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build
-DCMAKE_BUILD_TYPE=Debug
-DCODE_COVERAGE=TRUE
-DBUILD_EXAMPLES=ON
- name: Build
run: >
${{ runner.workspace }}/build-wrapper-linux-x86/build-wrapper-linux-x86-64
--out-dir $GITHUB_WORKSPACE/build/output
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
working-directory: ${{ runner.workspace }}/powsybl-iidm4cpp
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: >
${{ runner.workspace }}/sonar/bin/sonar-scanner
-Dsonar.host.url=https://sonarcloud.io