-
Notifications
You must be signed in to change notification settings - Fork 27
120 lines (97 loc) · 3.64 KB
/
build_linux_python.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
name: Linux Python
on:
workflow_call:
jobs:
python:
strategy:
fail-fast: false
matrix:
include:
- { os: "ubuntu-20.04", python-version: "3.8" }
- { os: "ubuntu-20.04", python-version: "3.9" }
- { os: "ubuntu-20.04", python-version: "3.10" }
- { os: "ubuntu-22.04", python-version: "3.11" }
- { os: "ubuntu-22.04", python-version: "3.12" }
runs-on: ${{matrix.os}}
name: ${{matrix.os}}-python${{matrix.python-version}}
steps:
- name: "Set up environment"
run: |
echo "PYLINT_ENABLED=1" >> ${GITHUB_ENV}
echo "MYPY_ENABLED=1" >> ${GITHUB_ENV}
- name: Apt update # with workaround for 'Unable to connect to ppa.launchpad.net' failure
run: sudo apt-get update --option Acquire::Retries=100 --option Acquire::http::Timeout="300"
- name: Install dependencies
run: sudo apt-get install gcc g++ graphviz doxygen
- name: Set up Java 8
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "8"
- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@v5
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
- name: "Checkout"
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download Zserio release artifact
uses: actions/download-artifact@v4
with:
name: zserio-bin-java8
- name: Build zserio C++ runtime (needed for python_cpp)
run: |
scripts/build.sh cpp_rt-linux64-gcc
- name: Build Zserio Python runtime
run: |
scripts/build.sh python_rt
- name: Pack Zserio Python runtime release
run: |
scripts/release.sh -p runtime_libs
- name: Run Zserio tests
run: |
scripts/test.sh python
- name: Run Zserio tests with extra arguments
run: |
export ZSERIO_EXTRA_ARGS="-withTypeInfoCode -withCodeComments"
scripts/test.sh -p -i arguments/without_writer_code python
export ZSERIO_EXTRA_ARGS="${ZSERIO_EXTRA_ARGS} -withValidationCode -withRangeCheckCode"
scripts/test.sh -p -x arguments/without_writer_code python
- name: Run Zserio integration tests for repeated generation
run: |
scripts/test_gen.sh python
- name: Run Zserio API compatibility checks
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
MYPY_ENABLED: 0
PYLINT_ENABLED: 0
run: |
scripts/test_compat_api.sh python
- name: Run Zserio performance tests
run: |
scripts/test_perf.sh python python-cpp \
--source-dir test/data/others/gif/zs --source gif.zs \
--blob-name gif.GifFile --blob-file test/data/others/gif/data/1pix.gif \
--num-iterations 1000 --test-config READ_WRITE
- name: Run Zserio benchmarks
run: |
scripts/benchmark.sh python python-cpp --num-iterations 1
- name: Upload Zserio Python runtime artifacts
uses: actions/upload-artifact@v4
# we want this artifact only once since it contains only sources
if: ${{ matrix.python-version == '3.8' }}
with:
name: "zserio-runtime-python"
path: release-*/*runtime-libs*
- name: Upload Zserio Python build artifacts
uses: actions/upload-artifact@v4
with:
name: "zserio-build-${{matrix.os}}-python${{matrix.python-version}}"
path: |
build/runtime_libs/python/**/zserio_cpp/**/*.so