Skip to content

Test on Windows

Test on Windows #116

name: Test on Windows
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
inputs:
debug_enabled:
description: 'Run the tests with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
schedule:
# Run at 8:13 on the 1st day of each month
- cron: '13 8 1 * *'
jobs:
MSVC:
runs-on: ${{matrix.config.runs_on}}
strategy:
fail-fast: false
matrix:
config:
- {runs_on: windows-2022, msvc_version_year: 2022, msvc_version: 17, multi_config: true, python_path: "C:\\Python39", msvc_program_files: "C:\\Program Files", config: Debug, cxx_standard: 17}
- {runs_on: windows-2022, msvc_version_year: 2022, msvc_version: 17, multi_config: true, python_path: "C:\\Python39", msvc_program_files: "C:\\Program Files", config: Release, cxx_standard: 17}
- {runs_on: windows-2022, msvc_version_year: 2022, msvc_version: 17, multi_config: false, python_path: "C:\\Python39", msvc_program_files: "C:\\Program Files", config: Debug, cxx_standard: 17}
- {runs_on: windows-2022, msvc_version_year: 2022, msvc_version: 17, multi_config: false, python_path: "C:\\Python39", msvc_program_files: "C:\\Program Files", config: Release, cxx_standard: 17}
- {runs_on: windows-2022, msvc_version_year: 2022, msvc_version: 17, multi_config: false, python_path: "C:\\Python39", msvc_program_files: "C:\\Program Files", config: Debug}
- {runs_on: windows-2022, msvc_version_year: 2022, msvc_version: 17, multi_config: false, python_path: "C:\\Python39", msvc_program_files: "C:\\Program Files", config: Release}
- {runs_on: windows-2019, msvc_version_year: 2019, msvc_version: 16, multi_config: false, python_path: "C:\\Python36", msvc_program_files: "C:\\Program Files (x86)", config: Debug, cxx_standard: 17}
- {runs_on: windows-2019, msvc_version_year: 2019, msvc_version: 16, multi_config: false, python_path: "C:\\Python36", msvc_program_files: "C:\\Program Files (x86)", config: Release, cxx_standard: 17}
- {runs_on: windows-2019, msvc_version_year: 2019, msvc_version: 16, multi_config: false, python_path: "C:\\Python36", msvc_program_files: "C:\\Program Files (x86)", config: Debug}
- {runs_on: windows-2019, msvc_version_year: 2019, msvc_version: 16, multi_config: false, python_path: "C:\\Python36", msvc_program_files: "C:\\Program Files (x86)", config: Release}
env:
PYTHON3_PATH: ${{matrix.config.python_path}}
CMAKE_GENERATOR: "Visual Studio ${{matrix.config.msvc_version}} ${{matrix.config.msvc_version_year}}"
ADDITIONAL_CMAKE_ARGS: -DFRUIT_USES_BOOST=False -T host=x64
CONFIGURATION: ${{matrix.config.config}}
VCVARSALL_DIR: "${{matrix.config.msvc_program_files}}\\Microsoft Visual Studio\\${{matrix.config.msvc_version_year}}\\Enterprise\\VC\\Auxiliary\\Build"
FRUIT_ALLOW_MULTI_CONFIG: ${{matrix.config.multi_config}}
steps:
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: set-cmake-debug-cxx-flags
if: matrix.config.config == 'Debug'
shell: bash
run: echo "ADDITIONAL_CMAKE_ARGS=$ADDITIONAL_CMAKE_ARGS -DCMAKE_CXX_FLAGS=\"/WX /DFRUIT_DEBUG /DFRUIT_EXTRA_DEBUG /D_ITERATOR_DEBUG_LEVEL=2\"" >> $GITHUB_ENV
- name: set-cmake-release-cxx-flags
if: matrix.config.config == 'Release'
shell: bash
run: echo "ADDITIONAL_CMAKE_ARGS=$ADDITIONAL_CMAKE_ARGS -DCMAKE_CXX_FLAGS=\"/WX\"" >> $GITHUB_ENV
- name: set-cmake-cxx-standard-flag
if: matrix.config.cxx_standard != ''
shell: bash
run: echo "ADDITIONAL_CMAKE_ARGS=$ADDITIONAL_CMAKE_ARGS -DCMAKE_CXX_STANDARD=${{matrix.config.cxx_standard}}" >> $GITHUB_ENV
- name: set-cmake-generator-arch-old-style
if: matrix.config.msvc_version < 16
shell: bash
run: echo "CMAKE_GENERATOR=$CMAKE_GENERATOR Win64" >> $GITHUB_ENV
- name: set-cmake-generator-arch-new-style
if: matrix.config.msvc_version >= 16
shell: bash
run: echo "ADDITIONAL_CMAKE_ARGS=$ADDITIONAL_CMAKE_ARGS -A x64" >> $GITHUB_ENV
- name: set-fruit-allow-multi-config
if: matrix.config.multi_config
shell: bash
run: echo "ADDITIONAL_CMAKE_ARGS=$ADDITIONAL_CMAKE_ARGS -DFRUIT_ALLOW_MULTI_CONFIG=True" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: install
shell: cmd
run: cmd /c extras\scripts\postsubmit.bat
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled && failure() }}
MinGW:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
config:
- {use_boost: false, config: Debug, extra_debug: true}
- {use_boost: false, config: Release}
- {use_boost: true, config: Release}
- {use_boost: true, config: Release, disable_shared_libs: true}
env:
PYTHON3_PATH: "C:\\Python39"
CMAKE_GENERATOR: 'MinGW Makefiles'
ADDITIONAL_CMAKE_ARGS: -DBUILD_SHARED_LIBS=${{!matrix.config.disable_shared_libs}} -DFRUIT_ADD_WNO_UNKNOWN_WARNING_OPTION=OFF
CONFIGURATION: ${{matrix.config.config}}
steps:
- name: Set up MinGW
uses: egor-tensin/setup-mingw@v2
- name: Build Boost
uses: egor-tensin/build-boost@v1
if: matrix.config.use_boost
with:
version: 1.80.0
libraries: headers
configuration: ${{matrix.config.config}}
- name: set-cmake-boost-flags
if: matrix.config.use_boost
shell: bash
run: echo "ADDITIONAL_CMAKE_ARGS=$ADDITIONAL_CMAKE_ARGS -DBoost_INCLUDE_DIR=D:\a\fruit\boost" >> $GITHUB_ENV
- name: set-cmake-non-boost-flags
if: ${{ !matrix.config.use_boost }}
shell: bash
run: echo "ADDITIONAL_CMAKE_ARGS=$ADDITIONAL_CMAKE_ARGS -DFRUIT_USES_BOOST=False" >> $GITHUB_ENV
- name: set-cmake-extra-debug-flags
if: matrix.config.extra_debug
shell: bash
run: echo "ADDITIONAL_CMAKE_ARGS=$ADDITIONAL_CMAKE_ARGS -DCMAKE_CXX_FLAGS=\"-Werror -DFRUIT_DEBUG=1 -DFRUIT_EXTRA_DEBUG=1 -D_GLIBCXX_DEBUG=1\"" >> $GITHUB_ENV
- name: set-cmake-no-extra-debug-flags
if: ${{ !matrix.config.extra_debug }}
shell: bash
run: echo "ADDITIONAL_CMAKE_ARGS=$ADDITIONAL_CMAKE_ARGS -DCMAKE_CXX_FLAGS=\"-Werror\"" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: install
shell: cmd
run: cmd /c extras\scripts\postsubmit.bat
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled && failure() }}