Skip to content

windows

windows #19

Workflow file for this run

name: windows
on:
pull_request:
types: [opened, synchronize]
branches:
- "*"
# Allow manual trigger for this workflow.
workflow_dispatch:
# Run every Monday
schedule:
- cron: "0 0 * * 1"
jobs:
build:
runs-on: windows-2022
name: windows
defaults:
run:
shell: pwsh
steps:
- uses: actions/checkout@v4
with:
submodules: true
# Add MSVC to the command line:
- if: runner.os == 'Windows'
name: Enable developer command prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Create build directory
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure
env:
CC: cl.exe
CXX: cl.exe
working-directory: ${{runner.workspace}}/build
run: |
cmake ${{github.workspace}} -DCMAKE_BUILD_TYPE=RelWithDebInfo -Wno-deprecated -G Ninja -DMINI_OPT_SERIALIZATION=ON -DMINI_OPT_TRACING=ON
- name: Build
working-directory: ${{runner.workspace}}/build
run: |
$threads = (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors
cmake --build . --config RelWithDebInfo --parallel $threads
- name: Run CTest
working-directory: ${{runner.workspace}}/build
run: ctest --output-on-failure
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install pre-commit
run: python -m pip install pre-commit
- name: Pre-commit checks
working-directory: ${{github.workspace}}
run: pre-commit run --all-files