Skip to content

Modernize CMake

Modernize CMake #81

Workflow file for this run

name: Windows
on:
pull_request:
branches: [master]
workflow_run:
workflows: [Build Dependencies on Windows]
types:
- completed
env:
BUILD_TYPE: Debug
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
windows-test:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Restore build cache
uses: actions/cache@v3
id: viennals-dependency-cache
with:
key: viennals-dependency-cache-${{ runner.os }}-${{env.BUILD_TYPE}}-${{ hashFiles( './external/upstream/**CMakeLists.txt' ) }}
path: ${{github.workspace}}/dependencies/Install
- name: Configure Git
# Workaround for windows, as the filename is 260 by default, however
# VTK has some files that exceed this limit, thus we need this workaround.
run: git config --system core.longpaths true
- name: Configure
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DVIENNALS_BUILD_TESTS=ON
- name: Build
run: cmake --build ${{github.workspace}}/build
- name: Add VTK to PATH
run: echo "${{github.workspace}}\dependencies\Install\vtk_external\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Run Tests
working-directory: ${{github.workspace}}/build
# Run all tests except those that are labeled as benchmark
run: ctest -E "Benchmark|Performance" -j 2 --output-on-failure --timeout 1800 -C ${{env.BUILD_TYPE}}
- name: Trigger Action on ViennaPS Repository
if: ${{ vars.TRIGGER_VIENNAPS == 'true' && github.event_name != 'schedule' && github.event_name != 'pull_request' }}
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PAT_VIENNAPS }}
repository: ${{github.repository_owner}}/ViennaPS
event-type: viennals-update-windows
windows-python:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Restore build cache
uses: actions/cache@v3
id: viennals-dependency-cache
with:
key: viennals-dependency-cache-${{ runner.os }}-${{env.BUILD_TYPE}}-${{ hashFiles( './external/upstream/**CMakeLists.txt' ) }}
path: ${{github.workspace}}/dependencies/Install
- name: Configure Git
# Workaround for windows, as the filename is 260 by default, however
# VTK has some files that exceed this limit, thus we need this workaround.
run: git config --system core.longpaths true
- name: Build and install Python module
shell: bash
run: pip3 install --user . -v