Skip to content

Merge pull request #8 from bbalouki/bbs-dev #4

Merge pull request #8 from bbalouki/bbs-dev

Merge pull request #8 from bbalouki/bbs-dev #4

Workflow file for this run

name: Windows
on:
push:
branches: [ "main" ]
jobs:
build-and-test:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
build_type: [Release, Debug]
cpp_standard: [20, 23]
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
BUILD_DIR: ${{ github.workspace }}/build
CMAKE_BUILD_PARALLEL_LEVEL: 4
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Cache vcpkg
uses: actions/cache@v4
with:
path: |
${{ env.VCPKG_ROOT }}
~/.cache/vcpkg
key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json') }}
restore-keys: |
${{ runner.os }}-vcpkg-
- name: Set up vcpkg
uses: lukka/run-vcpkg@v11
- name: Cache CMake build
uses: actions/cache@v4
with:
path: ${{ env.BUILD_DIR }}
key: ${{ runner.os }}-${{ matrix.build_type }}-cmake-${{ hashFiles('CMakeLists.txt', '**/CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.build_type }}-cmake-
- name: Configure CMake
shell: bash
run: |
cmake -S . -B $BUILD_DIR \
-DITCH_PROJECT_ENV=PROD \
-DITCH_BUILD_TESTS=ON \
-DITCH_CXX_STANDARD=${{ matrix.cpp_standard }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=x64-windows
- name: Build
shell: bash
run: cmake --build $BUILD_DIR --config ${{ matrix.build_type }}
- name: Run tests
shell: bash
run: ctest --test-dir $BUILD_DIR --output-on-failure --build-config ${{ matrix.build_type }}