mirror of
https://github.com/vtil-project/VTIL-Core
synced 2026-08-17 08:23:03 -04:00
52 lines
1.5 KiB
YAML
52 lines
1.5 KiB
YAML
name: CMake
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
build:
|
|
# Skip building pull requests from the same repository
|
|
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: windows-2022
|
|
build_parallel: 4
|
|
- os: ubuntu-24.04
|
|
build_parallel: 2
|
|
- os: macos-14
|
|
build_parallel: 2
|
|
env:
|
|
BUILD_TYPE: Release
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Ninja (Linux)
|
|
if: ${{ runner.os == 'Linux' }}
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y ninja-build
|
|
|
|
- name: Install Ninja (macOS)
|
|
if: ${{ runner.os == 'macOS' }}
|
|
run: brew install ninja
|
|
|
|
- name: Install Ninja (Windows)
|
|
if: ${{ runner.os == 'Windows' }}
|
|
run: choco install ninja -y
|
|
|
|
- name: Enable Developer Command Prompt
|
|
if: ${{ runner.os == 'Windows' }}
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
- name: Build
|
|
run: |
|
|
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DVTIL_BUILD_TESTS=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
|
|
cmake --build build --config ${{ env.BUILD_TYPE }} --parallel ${{ matrix.build_parallel }} --verbose
|
|
|
|
- name: Test
|
|
run: |
|
|
ctest --version
|
|
ctest --test-dir build -C ${{ env.BUILD_TYPE }} --output-on-failure --verbose
|