-
Notifications
You must be signed in to change notification settings - Fork 27
158 lines (135 loc) · 5.32 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
name: Windows
on:
push:
branches: [ master, '*-ci' ]
pull_request:
branches: [ master ]
jobs:
build_windows:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: ["windows-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
env:
ANT: "/c/ProgramData/chocolatey/lib/ant/tools/apache-ant-1.10.13/bin/ant"
CPPCHECK_HOME: "/c/Program Files/Cppcheck"
SPOTBUGS_HOME: "${{github.workspace}}/spotbugs-3.1.12"
PYLINT_ENABLED: 1
MYPY_ENABLED: 1
NU_HTML_VALIDATOR: "${{github.workspace}}/vnu-20.6.30/vnu.jar"
XMLLINT_ENABLED: 1
MINGW64_TOOLCHAIN_ROOT: "/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64"
MSVC_CMAKE_TOOLSET: "v141"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
- 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 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 gcovr
- name: Set up MinGW
uses: egor-tensin/setup-mingw@v2
with:
platform: x64
version: 11.3.0
- name: Install dependecies
run: |
choco install wget
choco install graphviz
choco install zip
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/3.1.12/spotbugs-3.1.12.zip
unzip "${{github.workspace}}\spotbugs-3.1.12.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: 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: |
ant -version
scripts/test.sh all-windows64-mingw cpp-windows64-msvc
shell: bash
env:
CMAKE_EXTRA_ARGS: "-DCMAKE_BUILD_TYPE=Release"
- name: Run Zserio C++ tests (Debug Build)
run: scripts/test.sh cpp-windows64-mingw # cpp-windows64-msvc - allocation tests does not work debug
shell: bash
env:
CMAKE_EXTRA_ARGS: "-DZSERIO_ENABLE_WERROR=1 -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 tests and compares produced BLOBs to check binary compatibility
run: scripts/test_compat_api.sh all-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/others/gif/data/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 10
shell: bash
- name: Archive Zserio release artifacts
uses: actions/upload-artifact@v3
with:
name: zserio-release-${{matrix.os}}-${{matrix.python-version}}
path: release-*
- name: Archive Zserio build artifacts
uses: actions/upload-artifact@v3
with:
name: zserio-build-${{matrix.os}}-${{matrix.python-version}}
path: |
build/runtime_libs/python/zserio_cpp/**/*.pyd
build/runtime_libs/cpp/**/runtime/*.a
build/runtime_libs/cpp/**/runtime/**/*.lib