2024-05-13 21:14:38 +00:00
|
|
|
name: Visual Studio
|
2023-10-28 14:44:02 +00:00
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-04-02 04:02:19 +00:00
|
|
|
msvc_arch: ['x64', 'amd64_x86', 'amd64_arm64']
|
|
|
|
# TODO: Re-add "Visual Studio 17 2022" once it's working.
|
2023-10-28 14:44:02 +00:00
|
|
|
cmake_generator: ['Ninja']
|
2024-04-02 04:02:19 +00:00
|
|
|
build_type: [release, debug]
|
|
|
|
build_options: [default, link_off, translations_only]
|
|
|
|
include:
|
|
|
|
- cmake_build: '-DCMAKE_BUILD_TYPE=Release'
|
|
|
|
build_type: release
|
|
|
|
- cmake_build: '-DCMAKE_BUILD_TYPE=Debug'
|
|
|
|
build_type: debug
|
|
|
|
- cmake_options: '-DENABLE_LINK=OFF'
|
|
|
|
build_options: link_off
|
|
|
|
- cmake_options: '-DTRANSLATIONS_ONLY=ON'
|
|
|
|
build_options: translations_only
|
2024-04-02 17:51:17 +00:00
|
|
|
- cmake_vcpkg_triplet: 'x64-windows-static'
|
|
|
|
msvc_arch: x64
|
|
|
|
- cmake_vcpkg_triplet: 'x86-windows-static'
|
|
|
|
msvc_arch: amd64_x86
|
|
|
|
- cmake_vcpkg_triplet: 'arm64-windows-static'
|
|
|
|
msvc_arch: amd64_arm64
|
|
|
|
exclude:
|
|
|
|
# Exclude debug/translations_only build
|
|
|
|
- build_type: debug
|
|
|
|
build_options: translations_only
|
|
|
|
- build_type: release
|
|
|
|
build_options: translations_only
|
|
|
|
msvc_arch: amd64_x86
|
|
|
|
- build_type: release
|
|
|
|
build_options: translations_only
|
|
|
|
msvc_arch: amd64_arm64
|
2023-10-28 14:44:02 +00:00
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout the code
|
2024-04-02 04:02:19 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-10-28 14:44:02 +00:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
- name: Prepare Visual Studio environment
|
2024-04-02 04:02:19 +00:00
|
|
|
uses: ilammy/msvc-dev-cmd@v1.13.0
|
2023-10-28 14:44:02 +00:00
|
|
|
with:
|
|
|
|
arch: ${{ matrix.msvc_arch }}
|
|
|
|
|
2024-04-02 17:51:17 +00:00
|
|
|
- name: Configure
|
2024-04-02 04:02:19 +00:00
|
|
|
run: >-
|
2024-04-02 17:51:17 +00:00
|
|
|
cmake -B build -G ${{ matrix.cmake_generator }} -DVCPKG_TARGET_TRIPLET=${{ matrix.cmake_vcpkg_triplet }} ${{ matrix.cmake_build }} ${{ matrix.cmake_options }}
|
2024-04-02 04:02:19 +00:00
|
|
|
|
2023-10-28 14:44:02 +00:00
|
|
|
- name: Build
|
|
|
|
run: cmake --build build
|
2024-05-06 04:28:55 +00:00
|
|
|
|
|
|
|
# Run tests
|
|
|
|
- if: matrix.build_options == 'default' && matrix.msvc_arch != 'amd64_arm64'
|
|
|
|
name: Run tests
|
2024-05-13 21:14:38 +00:00
|
|
|
run: cd build && ctest -j --output-on-failure
|