Skip to content

Adding visual studio build tools. #9

Adding visual studio build tools.

Adding visual studio build tools. #9

Workflow file for this run

name: CI
on:
push:
branches: [ '**' ]
pull_request:
branches: [ '**' ]
jobs:
build-and-test:
name: ${{ matrix.os }} Build and Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v1
with:
cmake-version: "3.20.0" # Specify the minimum version you need
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
run: |
choco install -y visualstudio2022buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional"
choco install -y ninja
shell: pwsh
- name: Install dependencies (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build clang
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew update
brew install ninja
brew install llvm
- name: Configure CMake
run: |
if [ "${{ matrix.os }}" == "windows-latest" ]; then
cmake -S . -B build -G "Visual Studio 17 2022" -A x64
else
cmake -S . -B build -G Ninja -DCMAKE_CXX_COMPILER=clang++
fi
- name: Build
run: |
if [ "${{ matrix.os }}" == "windows-latest" ]; then
cmake --build build --config Debug
else
cmake --build build
fi
- name: Run tests
run: |
if [ "${{ matrix.os }}" == "windows-latest" ]; then
ctest --test-dir build --output-on-failure --config Debug
else
ctest --test-dir build --output-on-failure
fi