forked from ndsev/zserio
-
Notifications
You must be signed in to change notification settings - Fork 0
170 lines (148 loc) · 6.61 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
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", "ubuntu-22.04"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
include:
- os: "ubuntu-20.04"
clang-version-suffix: "-11"
- os: "ubuntu-22.04"
clang-version-suffix: "-14"
env:
CPPCHECK_HOME: "${{github.workspace}}/cppcheck-2.6"
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
CLANG_VERSION_SUFFIX: "${{matrix.clang-version-suffix}}"
CMAKE_BUILD_OPTIONS: "-j2"
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: 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 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/3.1.12/spotbugs-3.1.12.zip -P "${GITHUB_WORKSPACE}"
unzip "${GITHUB_WORKSPACE}"/spotbugs-3.1.12.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
# 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"
GCOVR_BIN: "gcovr"
LLVM_PROFDATA_BIN: "llvm-profdata${{matrix.clang-version-suffix}}"
LLVM_COV_BIN: "llvm-cov${{matrix.clang-version-suffix}}"
SANITIZERS_ENABLED: 1
- name: Pack Zserio release
run: scripts/release.sh
- name: Run Zserio tests
# clang-tidy cannot be run because of time limit
# -DZSERIO_ENABLE_WERROR=1 fails for gcc because of false positive warning
run: |
unset JAVA_TOOL_OPTIONS # workaround https://github.com/actions/virtual-environments/issues/1437
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)
# clang-tidy cannot be run because of time limit
# sanitizers do not work on cpp-linux32-clang when cross-compiling
run: 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: |
unset JAVA_TOOL_OPTIONS # workaround https://github.com/actions/virtual-environments/issues/1437
scripts/test_gen.sh all-linux64-gcc cpp-linux32-gcc cpp-linux64-clang cpp-linux32-clang
- name: Run Zserio API compatibility checks
run: |
unset JAVA_TOOL_OPTIONS # workaround https://github.com/actions/virtual-environments/issues/1437
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: |
unset JAVA_TOOL_OPTIONS # workaround https://github.com/actions/virtual-environments/issues/1437
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: |
unset JAVA_TOOL_OPTIONS # workaround https://github.com/actions/virtual-environments/issues/1437
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}}-${{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/**/*.so
build/runtime_libs/cpp/**/runtime/*.a