fmt/.github/workflows/windows.yml

101 lines
3.2 KiB
YAML
Raw Normal View History

2020-11-03 18:46:03 +00:00
name: windows
2020-11-03 18:45:16 +00:00
2020-11-04 00:01:26 +00:00
on: [push, pull_request]
2020-11-03 18:45:16 +00:00
permissions:
contents: read
2020-11-03 18:45:16 +00:00
jobs:
build:
2020-11-03 20:16:15 +00:00
runs-on: ${{matrix.os}}
strategy:
matrix:
# windows-2019 has MSVC 2019 installed;
# windows-2022 has MSVC 2022 installed:
# https://github.com/actions/virtual-environments.
2022-07-04 15:39:30 +00:00
os: [windows-2019]
2020-11-03 20:16:15 +00:00
platform: [Win32, x64]
2022-07-28 18:05:04 +00:00
toolset: [v140, v141, v142]
standard: [14, 17, 20]
shared: ["", -DBUILD_SHARED_LIBS=ON]
2020-11-03 20:16:15 +00:00
build_type: [Debug, Release]
2022-07-28 18:05:04 +00:00
exclude:
- { toolset: v140, standard: 17 }
- { toolset: v140, standard: 20 }
- { toolset: v141, standard: 14 }
- { toolset: v141, standard: 20 }
- { toolset: v142, standard: 14 }
- { platform: Win32, toolset: v140 }
- { platform: Win32, toolset: v141 }
- { platform: Win32, standard: 14 }
- { platform: Win32, standard: 20 }
- { platform: x64, toolset: v140, shared: -DBUILD_SHARED_LIBS=ON }
- { platform: x64, toolset: v141, shared: -DBUILD_SHARED_LIBS=ON }
- { platform: x64, standard: 14, shared: -DBUILD_SHARED_LIBS=ON }
- { platform: x64, standard: 20, shared: -DBUILD_SHARED_LIBS=ON }
include:
2022-07-04 15:39:30 +00:00
- os: windows-2022
platform: x64
2022-07-28 18:05:04 +00:00
toolset: v143
2022-07-04 15:39:30 +00:00
build_type: Debug
standard: 20
2020-11-03 18:45:16 +00:00
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
2020-11-03 18:45:16 +00:00
- name: Set timezone
run: tzutil /s "Ekaterinburg Standard Time"
2020-11-03 18:45:16 +00:00
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
2020-11-03 22:02:07 +00:00
- name: Configure
2020-11-03 20:16:15 +00:00
# Use a bash shell for $GITHUB_WORKSPACE.
2020-11-03 18:45:16 +00:00
shell: bash
working-directory: ${{runner.workspace}}/build
2020-11-03 20:16:15 +00:00
run: |
2022-07-28 18:05:04 +00:00
cmake -A ${{matrix.platform}} -T ${{matrix.toolset}} \
-DCMAKE_CXX_STANDARD=${{matrix.standard}} \
2022-07-28 18:05:04 +00:00
${{matrix.shared}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
$GITHUB_WORKSPACE
2020-11-03 18:45:16 +00:00
- name: Build
working-directory: ${{runner.workspace}}/build
run: |
$threads = (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors
cmake --build . --config ${{matrix.build_type}} --parallel $threads
2020-11-03 18:45:16 +00:00
- name: Test
working-directory: ${{runner.workspace}}/build
run: ctest -C ${{matrix.build_type}} -V
env:
CTEST_OUTPUT_ON_FAILURE: True
2022-08-09 10:44:37 +00:00
mingw:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
strategy:
matrix:
sys: [ mingw64, ucrt64 ]
2022-08-09 10:44:37 +00:00
steps:
- name: Set timezone
run: tzutil /s "Ekaterinburg Standard Time"
shell: cmd
- uses: msys2/setup-msys2@7efe20baefed56359985e327d329042cde2434ff # v2
2022-08-09 10:44:37 +00:00
with:
release: false
msystem: ${{matrix.sys}}
pacboy: cc:p cmake:p ninja:p lld:p
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
2022-08-09 10:44:37 +00:00
- name: Configure
run: cmake -B ../build -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug
env: { LDFLAGS: -fuse-ld=lld }
- name: Build
run: cmake --build ../build
- name: Test
run: ctest -j `nproc` --test-dir ../build
env:
CTEST_OUTPUT_ON_FAILURE: True