-
Notifications
You must be signed in to change notification settings - Fork 8
198 lines (162 loc) · 8.26 KB
/
build-on-change-windows.yaml
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
name: Build framework on Windows
on:
# execute on every PR made targeting the branches bellow
pull_request:
branches:
- main
paths: # we only include paths critical for building to avoid unnecessary runs
- src/**
- include/**
- scripts/cmake/**
- test/**
- .github/workflows/**
- doc/**
- qc_framework/**
- docker/**
# execute on every push made targeting the branches bellow
push:
branches:
- main
paths: # we only include paths critical for building to avoid unnecessary runs
- src/**
- include/**
- scripts/cmake/**
- test/**
- .github/workflows/**
- doc/**
- qc_framework/**
- docker/**
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
build-windows:
runs-on: windows-2019
env:
TEST_ENABLED: ${{ github.event_name == 'pull_request' && 'ON' || 'OFF' }}
WORKING_PATH: "D:\\a"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Install Qt
uses: jurplel/[email protected]
with:
version: 5.15.2
host: windows
target: desktop
arch: win64_msvc2019_64
- name: Install gtest
env:
CXX: g++-10
run: |
Write-Output "Installing gtest..."
git clone https://github.com/google/googletest.git -b release-1.10.0
cd googletest
mkdir build
cd build
cmake -G "Visual Studio 16 2019" `
-Dgtest_force_shared_crt=ON `
-DCMAKE_INSTALL_PREFIX="$env:WORKING_PATH\gtest-Out" ..
cmake --build . --config Release
cmake --build . --config Release --target install
Write-Output "Gtest installed."
shell: pwsh
- name: Install XercesC
run: |
Write-Output "Setting up Xerces-C++..."
$xercesZip = "$env:WORKING_PATH\xerces-c-3.2.5.zip"
Invoke-WebRequest -Uri "https://dlcdn.apache.org/xerces/c/3/sources/xerces-c-3.2.5.zip" -OutFile $xercesZip
Expand-Archive -Path $xercesZip -DestinationPath "$env:WORKING_PATH"
cd "$env:WORKING_PATH\xerces-c-3.2.5"
mkdir build
cd build
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX="$env:WORKING_PATH\Xerces-Out" ..
cmake --build . --config Release
cmake --build . --config Release --target install
Add-Content $env:GITHUB_PATH "$env:WORKING_PATH\bin\xerces-c_3_2D.dll"
Add-Content $env:GITHUB_PATH "$env:WORKING_PATH\Xerces-Out\include"
Add-Content $env:GITHUB_PATH "$env:WORKING_PATH\Xerces-Out\bin"
shell: pwsh
- name: Build framework
run: |
Write-Output "Setting up QC-Framework..."
cd "$env:WORKING_PATH\qc-framework\qc-framework"
mkdir build
cmake -H"$env:WORKING_PATH\qc-framework\qc-framework" -S. -Bbuild `
-G "Visual Studio 16 2019" -A x64 -T v142 `
-DCMAKE_INSTALL_PREFIX="$env:WORKING_PATH\QC-Framework-Out" `
-DENABLE_FUNCTIONAL_TESTS="$env:TEST_ENABLED" `
-DGTest_ROOT="$env:WORKING_PATH\gtest-Out" `
-DQt5_ROOT="$env:Qt5_DIR\Qt5\" `
-DXercesC_ROOT="$env:WORKING_PATH\Xerces-Out"
cmake --build build --target ALL_BUILD --config Release
cmake --install build
# Final output
Write-Output "All installations and setups are complete!"
shell: pwsh
- name: Archive release binaries
run: |
mkdir artifacts
copy .\build\src\result_pooling\Release\ResultPooling.exe .\artifacts\
copy .\build\src\report_modules\report_module_text\Release\TextReport.exe .\artifacts\
copy .\build\src\report_modules\report_module_github_ci\Release\GithubCIReport.exe .\artifacts\
copy .\build\src\report_modules\report_module_gui\Release\ReportGUI.exe .\artifacts\
shell: cmd
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: qc-framework-executables-windows
path: artifacts
- name: Unit test execution
run: |
Write-Output "Starting unit tests..."
cd "$env:WORKING_PATH\qc-framework\qc-framework"
ctest --test-dir build -C Release
Write-Output "All unit tests done."
shell: pwsh
- name: Archive test results
uses: actions/upload-artifact@v4
with:
name: test-report
path: ${{ github.workspace }}\build\Testing\Temporary\LastTest.log
- name: Framework test execution
run: |
Write-Output "Starting framework tests..."
Rename-Item -path "$env:WORKING_PATH\qc-framework\qc-framework\build" -NewName "$env:WORKING_PATH\qc-framework\qc-framework\out_build"
Copy-Item -Path "$env:WORKING_PATH\QC-Framework-Out\bin" -Destination "$env:WORKING_PATH\qc-framework\qc-framework\bin" -Recurse
Copy-Item -Path "$env:WORKING_PATH\qc-framework\qc-framework\out_build\examples\checker_bundle_example\Release\DemoCheckerBundle.exe" -Destination "$env:WORKING_PATH\qc-framework\qc-framework\bin"
cd "$env:WORKING_PATH\qc-framework\qc-framework\qc_framework"
python3 -m pip install poetry
python3 -m poetry install
python3 -m poetry run pytest
Write-Output "All framework tests done."
shell: pwsh
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Execute checker bundles
run: |
$env:ASAM_QC_FRAMEWORK_MANIFEST_DIR="$env:WORKING_PATH\qc-framework\qc-framework\.github\workflows\windows-manifest"
$env:ASAM_QC_FRAMEWORK_INSTALLATION_DIR="$env:WORKING_PATH\QC-Framework-Out\bin"
git config --system core.longpaths true
pip install -e $env:WORKING_PATH\qc-framework\qc-framework\qc_framework
mkdir "$env:WORKING_PATH\odr_out"
pip install asam-qc-opendrive@git+https://github.com/asam-ev/qc-opendrive@main
qc_runtime --config="$env:WORKING_PATH\qc-framework\qc-framework\.github\workflows\windows-files\odr_config.xml" --manifest="$env:WORKING_PATH\qc-framework\qc-framework\.github\workflows\windows-manifest\framework.json" --working_dir="$env:WORKING_PATH\odr_out"
if (-not (Test-Path "$env:WORKING_PATH\odr_out\xodr_bundle_report.xqar")) { Throw "Error: Odr output does not exist." }
if (-not (Test-Path "$env:WORKING_PATH\odr_out\Result.xqar")) { Throw "Error: Odr output does not exist." }
if (-not (Test-Path "$env:WORKING_PATH\odr_out\Report.txt")) { Throw "Error: Odr output does not exist." }
mkdir "$env:WORKING_PATH\osc_out"
pip install asam-qc-openscenarioxml@git+https://github.com/asam-ev/qc-openscenarioxml@main
qc_runtime --config="$env:WORKING_PATH\qc-framework\qc-framework\.github\workflows\windows-files\osc_config.xml" --manifest="$env:WORKING_PATH\qc-framework\qc-framework\.github\workflows\windows-manifest\framework.json" --working_dir="$env:WORKING_PATH\osc_out"
if (-not (Test-Path "$env:WORKING_PATH\osc_out\xosc_bundle_report.xqar")) { Throw "Error: Osc output does not exist." }
if (-not (Test-Path "$env:WORKING_PATH\osc_out\Result.xqar")) { Throw "Error: Osc output does not exist." }
if (-not (Test-Path "$env:WORKING_PATH\osc_out\Report.txt")) { Throw "Error: Odr output does not exist." }
mkdir "$env:WORKING_PATH\otx_out"
pip install asam-qc-otx@git+https://github.com/asam-ev/qc-otx@main
qc_runtime --config="$env:WORKING_PATH\qc-framework\qc-framework\.github\workflows\windows-files\otx_config.xml" --manifest="$env:WORKING_PATH\qc-framework\qc-framework\.github\workflows\windows-manifest\framework.json" --working_dir="$env:WORKING_PATH\otx_out"
if (-not (Test-Path "$env:WORKING_PATH\otx_out\otx_bundle_report.xqar")) { Throw "Error: Otx output does not exist." }
if (-not (Test-Path "$env:WORKING_PATH\otx_out\Result.xqar")) { Throw "Error: Otx output does not exist." }
if (-not (Test-Path "$env:WORKING_PATH\otx_out\Report.txt")) { Throw "Error: Odr output does not exist." }
shell: pwsh