Skip to content

Fix CodeQL version to 2.13.5 according to codeql-coding-standards #709

Fix CodeQL version to 2.13.5 according to codeql-coding-standards

Fix CodeQL version to 2.13.5 according to codeql-coding-standards #709

Workflow file for this run

name: Windows
on:
push:
branches: [ master, '*-ci' ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build_windows:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: ["windows-2022"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
java-version: ["8"]
cxx-standard-version: ["11"]
msvc-toolset-version: ["v141"]
mingw-version: ["7.5.0"]
include:
# Java 11
- os: "windows-2022"
python-version: "3.8"
java-version: "11"
cxx-standard-version: "11"
msvc-toolset-version: "v141"
mingw-version: "7.5.0"
# Java 17
- os: "windows-2022"
python-version: "3.8"
java-version: "17"
cxx-standard-version: "11"
msvc-toolset-version: "v141"
mingw-version: "7.5.0"
# C++11, MSVC toolset v142 (MSVC 2019), MinGW 9.4.0
- os: "windows-2022"
python-version: "3.8"
java-version: "8"
cxx-standard-version: "11"
msvc-toolset-version: "v142"
mingw-version: "9.4.0"
# C++17, MSVC toolset v142 (MSVC 2019), MinGW 9.4.0
- os: "windows-2022"
python-version: "3.8"
java-version: "8"
cxx-standard-version: "17"
msvc-toolset-version: "v142"
mingw-version: "9.4.0"
name: |
OS ${{matrix.os}}, Python ${{matrix.python-version}},
Java ${{matrix.java-version}}, C++${{matrix.cxx-standard-version}},
MSVC ${{matrix.msvc-toolset-version}}, MinGW ${{matrix.mingw-version}}
env:
CPPCHECK_HOME: "/c/Program Files/Cppcheck"
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
CMAKE_CXX_STANDARD: "${{matrix.cxx-standard-version}}"
MINGW64_TOOLCHAIN_ROOT: "/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64"
MSVC_CMAKE_TOOLSET: ${{matrix.msvc-toolset-version}}
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: 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 ANT variable
run: |
echo "ANT=/${ANT_HOME}/bin/ant" | 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 setuptools # necessary for pkg_resources on Python 3.12
python -m pip install gcovr
- name: Install dependecies
run: |
choco install wget
choco install doxygen.portable
choco install graphviz
choco install zip
choco install mingw --version ${{matrix.mingw-version}}
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/4.8.2/spotbugs-4.8.2.zip
unzip "${{github.workspace}}\spotbugs-4.8.2.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: |
scripts/test.sh all-windows64-mingw cpp-windows64-msvc
shell: bash
env:
CMAKE_EXTRA_ARGS: "-DCMAKE_BUILD_TYPE=Release"
- name: Run Zserio tests (Debug Build)
# -DZSERIO_ENABLE_WERROR=1 fails for mingw because of false positive warning
# allocation tests do not work for MSVC Debug
run: |
scripts/test.sh cpp-windows64-mingw
shell: bash
env:
CMAKE_EXTRA_ARGS: "-DCMAKE_BUILD_TYPE=Debug"
- name: Run Zserio tests with extra arguments
# -DZSERIO_ENABLE_WERROR=1 fails for mingw because of false positive warning
run: |
# -withRangeCheckCode -withValidationCode conflicts with -withoutWriterCode
export ZSERIO_EXTRA_ARGS="-withTypeInfoCode -withCodeComments"
scripts/test.sh -p -i arguments/without_writer_code java python
ZSERIO_EXTRA_ARGS="${ZSERIO_EXTRA_ARGS} -setCppAllocator polymorphic -withReflectionCode" \
scripts/test.sh -p -i arguments/without_writer_code cpp-windows64-mingw cpp-windows64-msvc
export ZSERIO_EXTRA_ARGS="${ZSERIO_EXTRA_ARGS} -withRangeCheckCode -withValidationCode"
scripts/test.sh -p -x arguments/without_writer_code java python
ZSERIO_EXTRA_ARGS="${ZSERIO_EXTRA_ARGS} -setCppAllocator polymorphic -withReflectionCode" \
scripts/test.sh -p -x arguments/without_writer_code cpp-windows64-mingw cpp-windows64-msvc
export ZSERIO_EXTRA_ARGS="-setTopLevelPackage top.level"
scripts/test.sh doc xml
shell: bash
env:
CMAKE_EXTRA_ARGS: "-DCMAKE_BUILD_TYPE=Release"
- name: Run Zserio tests with extra arguments (Debug Build)
# -DZSERIO_ENABLE_WERROR=1 fails for mingw because of false positive warning
# allocation tests do not work for MSVC Debug
run: |
# -withRangeCheckCode -withValidationCode conflicts with -withoutWriterCode
export ZSERIO_EXTRA_ARGS="-withTypeInfoCode -withCodeComments \
-setCppAllocator polymorphic -withReflectionCode"
scripts/test.sh -p -i arguments/without_writer_code cpp-windows64-mingw
# disabled because of 6 hours time limit
# export ZSERIO_EXTRA_ARGS="${ZSERIO_EXTRA_ARGS} -withRangeCheckCode -withValidationCode"
# scripts/test.sh -p -x arguments/without_writer_code cpp-windows64-mingw
shell: bash
env:
CMAKE_EXTRA_ARGS: "-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 API compatibility checks
run: scripts/test_compat_api.sh java python cpp-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/data/others/gif/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 1
shell: bash
- name: Archive Zserio release artifacts
uses: actions/upload-artifact@v3
with:
name: zserio-release-${{matrix.os}}-python${{matrix.python-version}}-java${{matrix.java-version}}-msvc${{matrix.msvc-toolset-version}}-mingw${{matrix.mingw-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}}-msvc${{matrix.msvc-toolset-version}}-mingw${{matrix.mingw-version}}
path: |
build/runtime_libs/python/**/zserio_cpp/**/*.pyd
build/runtime_libs/cpp/**/runtime/*.a
build/runtime_libs/cpp/**/runtime/**/*.lib