mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-10-20 23:56:17 +02:00
- Use sccache: https://github.com/mozilla/sccache to speed up CI - Not huge benefits for Windows but mac and linux really improves
55 lines
1.6 KiB
YAML
55 lines
1.6 KiB
YAML
name: Build and test on Windows
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-latest
|
|
|
|
env:
|
|
# sccache keeps compiled objects in the GitHub Actions cache, so later
|
|
# runs only recompile the translation units a change affects
|
|
SCCACHE_GHA_ENABLED: "true"
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-python@v7
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Install Python dependencies
|
|
run: python -m pip install ninja numpy matplotlib pytest pytest-check boost-histogram
|
|
|
|
# Puts cl.exe on the path so that CMake can use the Ninja generator.
|
|
# Pinned to a release tag: the v4 ref of this action is a branch.
|
|
- uses: TheMrMilchmann/setup-msvc-dev@v4.1.0
|
|
with:
|
|
arch: x64
|
|
|
|
- uses: mozilla-actions/sccache-action@v0.0.11
|
|
with:
|
|
version: "v0.18.0"
|
|
|
|
# Precompiled headers are disabled: sccache cannot cache MSVC
|
|
# compilations that use one
|
|
- name: Configure
|
|
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DAARE_TESTS=ON -DAARE_PYTHON_BINDINGS=ON -DAARE_WARNINGS_AS_ERRORS=ON -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
|
|
|
|
- name: Build
|
|
run: cmake --build build
|
|
|
|
- name: Compiler cache statistics
|
|
run: sccache --show-stats
|
|
|
|
- name: C++ unit tests
|
|
run: ctest --test-dir build --output-on-failure -j4
|
|
|
|
- name: Python unit tests
|
|
env:
|
|
PYTHONPATH: ${{ github.workspace }}\build
|
|
run: python -m pytest python/tests
|