-
Notifications
You must be signed in to change notification settings - Fork 27
205 lines (181 loc) · 7.69 KB
/
build_linux.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
name: Linux
on:
push:
branches: [ master, '*-ci' ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build_linux:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: ["ubuntu-20.04"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
java-version: ["8"]
gcc-version: ["7"]
clang-version: ["11"]
include:
# Java 11
- os: "ubuntu-20.04"
python-version: "3.8"
java-version: "11"
gcc-version: "7"
clang-version: "11"
# Java 17
- os: "ubuntu-20.04"
python-version: "3.8"
java-version: "17"
gcc-version: "7"
clang-version: "11"
# Ubuntu 22.04, gcc 11 with gcovr, Clang 14
- os: "ubuntu-22.04"
python-version: "3.8"
java-version: "8"
gcc-version: "11"
clang-version: "14"
name: |
OS ${{matrix.os}}, Python ${{matrix.python-version}},
Java ${{matrix.java-version}}, gcc ${{matrix.gcc-version}},
Clang ${{matrix.clang-version}}
env:
CPPCHECK_HOME: "${{github.workspace}}/cppcheck-2.6"
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
GCC_VERSION_SUFFIX: "-${{matrix.gcc-version}}"
CLANG_VERSION_SUFFIX: "-${{matrix.clang-version}}"
CMAKE_BUILD_OPTIONS: "-j2"
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: 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: Workaround for 'Unable to connect to ppa.launchpad.net' failure during installation
run: sudo apt-get update --option Acquire::Retries=100 --option Acquire::http::Timeout="300"
- name: Install gcc-${{matrix.gcc-version}} compiler
run: |
sudo apt-get install gcc-${{matrix.gcc-version}}
sudo apt-get install g++-${{matrix.gcc-version}} g++-${{matrix.gcc-version}}-multilib
- name: Install clang-${{matrix.clang-version}} compiler
run: |
sudo apt-get install clang-${{matrix.clang-version}}
sudo apt-get install llvm-${{matrix.clang-version}}
if [ -f "`which clang-format-14`" ] ; then
echo "CLANG_FORMAT_BIN=clang-format-14" >> ${GITHUB_ENV}
fi
- name: Install dependencies
run: sudo apt-get install cmake doxygen graphviz g++-multilib
- name: Install specific version of C++ static code analysis tool (cppcheck)
run: |
wget https://github.com/danmar/cppcheck/archive/2.6.tar.gz -P "${GITHUB_WORKSPACE}" -O cppcheck-2.6.tar.gz
tar -xf "${GITHUB_WORKSPACE}"/cppcheck-2.6.tar.gz
mkdir "${GITHUB_WORKSPACE}/cppcheck-2.6/build"
pushd "${GITHUB_WORKSPACE}/cppcheck-2.6/build"
cmake .. -DHAVE_RULES=ON -DUSE_MATCHCOMPILER=ON \
-DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE}"/cppcheck-2.6 \
-DCMAKE_INSTALL_BINDIR=. \
-DCMAKE_BUILD_TYPE=Release \
-DFILESDIR=.
cmake --build . --target install
popd
- name: Install specific version of Java static code analysis tool (spotbugs)
run: |
wget https://repo.maven.apache.org/maven2/com/github/spotbugs/spotbugs/4.8.2/spotbugs-4.8.2.zip -P "${GITHUB_WORKSPACE}"
unzip "${GITHUB_WORKSPACE}"/spotbugs-4.8.2.zip
- name: Install specific version of HTML validator (v.Nu)
run: |
wget https://github.com/validator/validator/releases/download/20.6.30/vnu.jar_20.6.30.zip -P "${GITHUB_WORKSPACE}"
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: sudo apt-get install libxml2-utils
- name: Build Zserio
run: scripts/build.sh all-linux64-gcc cpp_rt-linux32-gcc cpp_rt-linux64-clang cpp_rt-linux32-clang
env:
CMAKE_EXTRA_ARGS: "-DZSERIO_ENABLE_WERROR=1 -DCMAKE_BUILD_TYPE=Release"
- name: Build Zserio C++ runtime (Debug Build)
run: |
if [ -f "`which clang-tidy-14`" ] ; then
export CLANG_TIDY_BIN=clang-tidy-14
fi
# gcovr works only for default gcc version
if [[ `gcc --version` == *" ${{matrix.gcc-version}}."* ]] ; then
export GCOVR_BIN="gcovr"
fi
# sanitizers do not work on cpp_rt-linux32-clang when cross-compiling
scripts/build.sh cpp_rt-linux64-gcc cpp_rt-linux32-gcc cpp_rt-linux64-clang
env:
CMAKE_EXTRA_ARGS: "-DZSERIO_ENABLE_WERROR=1 -DCMAKE_BUILD_TYPE=Debug"
LLVM_PROFDATA_BIN: "llvm-profdata-${{matrix.clang-version}}"
LLVM_COV_BIN: "llvm-cov-${{matrix.clang-version}}"
SANITIZERS_ENABLED: 1
- name: Pack Zserio release
run: scripts/release.sh
- name: Run Zserio tests
# -DZSERIO_ENABLE_WERROR=1 fails for gcc because of false positive warning
run: |
scripts/test.sh all-linux64-gcc cpp-linux32-gcc cpp-linux64-clang cpp-linux32-clang
env:
CMAKE_EXTRA_ARGS: "-DCMAKE_BUILD_TYPE=Release"
- name: Run Zserio C++ tests (Debug Build)
# sanitizers do not work on cpp-linux32-clang when cross-compiling
run: |
if [ -f "`which clang-tidy-14`" ] ; then
export CLANG_TIDY_BIN=clang-tidy-14
fi
scripts/test.sh cpp-linux32-gcc cpp-linux64-gcc cpp-linux64-clang
env:
CMAKE_EXTRA_ARGS: "-DZSERIO_ENABLE_WERROR=1 -DCMAKE_BUILD_TYPE=Debug"
SANITIZERS_ENABLED: 1
- name: Run Zserio integration tests for repeated generation
run: |
scripts/test_gen.sh all-linux64-gcc cpp-linux32-gcc cpp-linux64-clang cpp-linux32-clang
- name: Run Zserio API compatibility checks
run: |
scripts/test_compat_api.sh java python cpp-linux64-clang
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-linux64-gcc cpp-linux64-clang cpp-linux32-gcc cpp-linux32-clang \
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
- name: Run Zserio benchmarks
run: |
scripts/benchmark.sh cpp-linux64-gcc cpp-linux64-clang cpp-linux32-gcc cpp-linux32-clang \
python python-cpp java --num-iterations 1
- name: Archive Zserio release artifacts
uses: actions/upload-artifact@v3
with:
name: zserio-release-${{matrix.os}}-python${{matrix.python-version}}-java${{matrix.java-version}}-gcc${{matrix.gcc-version}}-clang${{matrix.clang-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}}-gcc${{matrix.gcc-version}}-clang${{matrix.clang-version}}
path: |
build/runtime_libs/python/**/zserio_cpp/**/*.so
build/runtime_libs/cpp/**/runtime/*.a