-
Notifications
You must be signed in to change notification settings - Fork 27
241 lines (216 loc) · 9.44 KB
/
build_windows.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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
name: Windows
on:
push:
branches: [ master, '*-ci' ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build_windows:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: ["windows-2022"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
java-version: ["8"]
cxx-standard-version: ["11"]
msvc-toolset-version: ["v141"]
mingw-version: ["7.5.0"]
include:
# Java 11
- os: "windows-2022"
python-version: "3.8"
java-version: "11"
cxx-standard-version: "11"
msvc-toolset-version: "v141"
mingw-version: "7.5.0"
# Java 17
- os: "windows-2022"
python-version: "3.8"
java-version: "17"
cxx-standard-version: "11"
msvc-toolset-version: "v141"
mingw-version: "7.5.0"
# C++11, MSVC toolset v142 (MSVC 2019), MinGW 9.4.0
- os: "windows-2022"
python-version: "3.8"
java-version: "8"
cxx-standard-version: "11"
msvc-toolset-version: "v142"
mingw-version: "9.4.0"
# C++17, MSVC toolset v142 (MSVC 2019), MinGW 9.4.0
- os: "windows-2022"
python-version: "3.8"
java-version: "8"
cxx-standard-version: "17"
msvc-toolset-version: "v142"
mingw-version: "9.4.0"
name: |
OS ${{matrix.os}}, Python ${{matrix.python-version}},
Java ${{matrix.java-version}}, C++${{matrix.cxx-standard-version}},
MSVC ${{matrix.msvc-toolset-version}}, MinGW ${{matrix.mingw-version}}
env:
CPPCHECK_HOME: "/c/Program Files/Cppcheck"
SPOTBUGS_HOME: "${{github.workspace}}/spotbugs-4.8.2"
PYLINT_ENABLED: 1
MYPY_ENABLED: 1
NU_HTML_VALIDATOR: "${{github.workspace}}/vnu-20.6.30/vnu.jar"
XMLLINT_ENABLED: 1
CMAKE_CXX_STANDARD: "${{matrix.cxx-standard-version}}"
MINGW64_TOOLCHAIN_ROOT: "/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64"
MSVC_CMAKE_TOOLSET: ${{matrix.msvc-toolset-version}}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Java ${{matrix.java-version}}
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{matrix.java-version}}
- name: Convert environment variables to POSIX paths
run: |
echo "SPOTBUGS_HOME=/${SPOTBUGS_HOME}" | sed -e 's/\\/\//g' -e 's/://' >> ${GITHUB_ENV}
echo "NU_HTML_VALIDATOR=/${NU_HTML_VALIDATOR}" | sed -e 's/\\/\//g' -e 's/://' >> ${GITHUB_ENV}
echo "JAVA_HOME=/${JAVA_HOME}" | sed -e 's/\\/\//g' -e 's/://' >> ${GITHUB_ENV}
shell: bash
- name: Set ANT variable
run: |
echo "ANT=/${ANT_HOME}/bin/ant" | sed -e 's/\\/\//g' -e 's/://' >> ${GITHUB_ENV}
shell: bash
- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@v4
with:
python-version: ${{matrix.python-version}}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install virtualenv
python -m pip install setuptools # necessary for pkg_resources on Python 3.12
python -m pip install gcovr
- name: Install dependecies
run: |
choco install wget
choco install doxygen.portable
choco install graphviz
choco install zip
choco install mingw --version ${{matrix.mingw-version}}
ls -l /c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64
choco install llvm --version=14.0.0 --allow-downgrade
echo "ECHO Program Files/LLVM/bin"
ls -l "/c/Program Files/LLVM/bin"
shell: bash
- name: Install specific version of C++ static code analysis tool (cppcheck)
run: choco install cppcheck --version=2.6
- name: Install specific version of Java static code analysis tool (spotbugs)
run: |
wget -P "${{github.workspace}}" https://repo.maven.apache.org/maven2/com/github/spotbugs/spotbugs/4.8.2/spotbugs-4.8.2.zip
unzip "${{github.workspace}}\spotbugs-4.8.2.zip"
- name: Install specific version of HTML validator (v.Nu)
run: |
wget -P "${{github.workspace}}" https://github.com/validator/validator/releases/download/20.6.30/vnu.jar_20.6.30.zip
unzip "${{github.workspace}}\vnu.jar_20.6.30.zip" -d "${{github.workspace}}"
mv "${{github.workspace}}\dist" "${{github.workspace}}\vnu-20.6.30"
- name: Install XML validator (xmllint)
run: choco install xsltproc
- name: Build Zserio
run: |
scripts/build.sh all-windows64-mingw cpp_rt-windows64-msvc
shell: bash
env:
CMAKE_EXTRA_ARGS: "-DZSERIO_ENABLE_WERROR=1 -DCMAKE_BUILD_TYPE=Release"
- name: Build Zserio C++ runtime (Debug Build)
run: |
export CLANG_TIDY_BIN="/c/Program Files/LLVM/bin/clang-tidy"
scripts/build.sh cpp_rt-windows64-mingw cpp_rt-windows64-msvc
shell: bash
env:
CMAKE_EXTRA_ARGS: "-DZSERIO_ENABLE_WERROR=1 -DCMAKE_BUILD_TYPE=Debug"
- name: Pack Zserio release
run: scripts/release.sh
shell: bash
- name: Run Zserio tests
# -DZSERIO_ENABLE_WERROR=1 fails for mingw because of false positive warning
run: |
export CLANG_TIDY_BIN="/c/Program Files/LLVM/bin/clang-tidy"
scripts/test.sh all-windows64-mingw cpp-windows64-msvc
shell: bash
env:
CMAKE_EXTRA_ARGS: "-DCMAKE_BUILD_TYPE=Release"
- name: Run Zserio tests (Debug Build)
# -DZSERIO_ENABLE_WERROR=1 fails for mingw because of false positive warning
# allocation tests do not work for MSVC Debug
run: |
scripts/test.sh cpp-windows64-mingw
shell: bash
env:
CMAKE_EXTRA_ARGS: "-DCMAKE_BUILD_TYPE=Debug"
- name: Run Zserio tests with extra arguments
# -DZSERIO_ENABLE_WERROR=1 fails for mingw because of false positive warning
run: |
# -withRangeCheckCode -withValidationCode conflicts with -withoutWriterCode
export ZSERIO_EXTRA_ARGS="-withTypeInfoCode -withCodeComments"
scripts/test.sh -p -i arguments/without_writer_code java python
ZSERIO_EXTRA_ARGS="${ZSERIO_EXTRA_ARGS} -setCppAllocator polymorphic -withReflectionCode" \
scripts/test.sh -p -i arguments/without_writer_code cpp-windows64-mingw cpp-windows64-msvc
export ZSERIO_EXTRA_ARGS="${ZSERIO_EXTRA_ARGS} -withRangeCheckCode -withValidationCode"
scripts/test.sh -p -x arguments/without_writer_code java python
ZSERIO_EXTRA_ARGS="${ZSERIO_EXTRA_ARGS} -setCppAllocator polymorphic -withReflectionCode" \
scripts/test.sh -p -x arguments/without_writer_code cpp-windows64-mingw cpp-windows64-msvc
export ZSERIO_EXTRA_ARGS="-setTopLevelPackage top.level"
scripts/test.sh doc xml
shell: bash
env:
CMAKE_EXTRA_ARGS: "-DCMAKE_BUILD_TYPE=Release"
- name: Run Zserio tests with extra arguments (Debug Build)
# -DZSERIO_ENABLE_WERROR=1 fails for mingw because of false positive warning
# allocation tests do not work for MSVC Debug
run: |
# -withRangeCheckCode -withValidationCode conflicts with -withoutWriterCode
export ZSERIO_EXTRA_ARGS="-withTypeInfoCode -withCodeComments \
-setCppAllocator polymorphic -withReflectionCode"
scripts/test.sh -p -i arguments/without_writer_code cpp-windows64-mingw
# disabled because of 6 hours time limit
# export ZSERIO_EXTRA_ARGS="${ZSERIO_EXTRA_ARGS} -withRangeCheckCode -withValidationCode"
# scripts/test.sh -p -x arguments/without_writer_code cpp-windows64-mingw
shell: bash
env:
CMAKE_EXTRA_ARGS: "-DCMAKE_BUILD_TYPE=Debug"
- name: Run Zserio integration tests for repeated generation
run: scripts/test_gen.sh all-windows64-mingw cpp-windows64-msvc
shell: bash
- name: Run Zserio API compatibility checks
run: scripts/test_compat_api.sh java python cpp-windows64-msvc
shell: bash
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
CPPCHECK_HOME: ""
SPOTBUGS_HOME: ""
PYLINT_ENABLED: 0
MYPY_ENABLED: 0
- name: Run Zserio performance tests
run: |
scripts/test_perf.sh cpp-windows64-mingw cpp-windows64-msvc python python-cpp java \
--source-dir test/others/gif/zs --source gif.zs \
--blob-name gif.GifFile --blob-file test/data/others/gif/1pix.gif \
--num-iterations 1000 --test-config READ_WRITE
shell: bash
- name: Run Zserio benchmarks
run: |
scripts/benchmark.sh cpp-windows64-mingw cpp-windows64-msvc python python-cpp java \
--num-iterations 1
shell: bash
- name: Archive Zserio release artifacts
uses: actions/upload-artifact@v3
with:
name: zserio-release-${{matrix.os}}-python${{matrix.python-version}}-java${{matrix.java-version}}-msvc${{matrix.msvc-toolset-version}}-mingw${{matrix.mingw-version}}
path: release-*
- name: Archive Zserio build artifacts
uses: actions/upload-artifact@v3
with:
name: zserio-build-${{matrix.os}}-python${{matrix.python-version}}-java${{matrix.java-version}}-msvc${{matrix.msvc-toolset-version}}-mingw${{matrix.mingw-version}}
path: |
build/runtime_libs/python/**/zserio_cpp/**/*.pyd
build/runtime_libs/cpp/**/runtime/*.a
build/runtime_libs/cpp/**/runtime/**/*.lib