-
Notifications
You must be signed in to change notification settings - Fork 27
104 lines (84 loc) · 3.3 KB
/
build_linux_java.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
name: Linux Java
on:
workflow_call:
jobs:
java:
strategy:
fail-fast: false
matrix:
include:
- { os: "ubuntu-20.04", java-version: 8 }
- { os: "ubuntu-20.04", java-version: 11 }
- { os: "ubuntu-22.04", java-version: 17 }
runs-on: ${{matrix.os}}
name: ${{matrix.os}}-java${{matrix.java-version}}
steps:
- name: "Set up environment"
run: |
if [[ "${{matrix.os}}" == "ubuntu-22.04" ]] ; then
echo "CLANG_FORMAT_BIN=clang-format-14" >> ${GITHUB_ENV}
fi
echo "SPOTBUGS_HOME=${RUNNER_WORKSPACE}/spotbugs-4.8.2" >> ${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: Set up Java ${{matrix.java-version}}
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{matrix.java-version}}
- name: Install clang-format-14 tool
if: ${{ env.CLANG_FORMAT_BIN != '' }}
run: |
sudo apt-get install clang-format-14
- 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 "${RUNNER_WORKSPACE}"
unzip "${RUNNER_WORKSPACE}"/spotbugs-4.8.2.zip -d "${RUNNER_WORKSPACE}"
- 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 Java runtime
run: |
scripts/build.sh java_rt
- name: Pack Zserio Java runtime release
run: |
scripts/release.sh -p runtime_libs
- name: Run Zserio tests
run: |
scripts/test.sh java
# DynamicBitFieldLengthBoundsTest fails with range checking - see https://github.com/ndsev/zserio/issues/79
- name: Run Zserio tests with extra arguments
run: |
export ZSERIO_EXTRA_ARGS="-withTypeInfoCode -withCodeComments"
scripts/test.sh -p -i arguments/without_writer_code -i language/builtin_types java
export ZSERIO_EXTRA_ARGS="${ZSERIO_EXTRA_ARGS} -withValidationCode -withRangeCheckCode"
scripts/test.sh -p -x arguments/without_writer_code -x language/builtin_types java
- name: Run Zserio integration tests for repeated generation
run: |
scripts/test_gen.sh java
- name: Run Zserio API compatibility checks
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
SPOTBUGS_HOME: ""
run: |
scripts/test_compat_api.sh java
- name: Run Zserio performance tests
run: |
scripts/test_perf.sh java \
--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 java --num-iterations 1
- name: Upload Zserio Java runtime artifacts
uses: actions/upload-artifact@v4
with:
name: "zserio-runtime-java${{matrix.java-version}}"
path: release-*/*runtime-libs*