Skip to content

build: add test coverage #60

build: add test coverage

build: add test coverage #60

Workflow file for this run

name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
linux:
strategy:
fail-fast: true
matrix:
config:
- preset: linux-x64-debug
- preset: linux-x64-release
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install System Packages
run: |
sudo apt-get update
sudo apt-get install build-essential cmake ninja-build
- name: Setup vcpkg
working-directory: /opt
run: |
rm -rf vcpkg
git clone https://github.com/Microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
./vcpkg/vcpkg integrate install
./vcpkg/vcpkg --version
test -d vcpkg-binary-cache || mkdir vcpkg-binary-cache
- name: Cache Vcpkg Dependencies
uses: actions/cache@v3
with:
key: ${{matrix.config.preset}}
path: /opt/vcpkg-binary-cache
- name: Configure
env:
VCPKG_ROOT: /opt/vcpkg
VCPKG_DEFAULT_BINARY_CACHE: /opt/vcpkg-binary-cache
run: cmake -S . --preset ${{matrix.config.preset}}
- name: Build
run: cmake --build --preset ${{matrix.config.preset}}
- name: Test
run: |
ctest --preset linux-tests
windows:
strategy:
fail-fast: true
matrix:
config:
- preset: windows-x64-debug
- preset: windows-x64-release
runs-on: windows-latest
steps:
- name: Prepare
uses: actions/checkout@v3
- name: Setup vcpkg
working-directory: C:\
shell: bash
run: |
rm -rf vcpkg
git clone https://github.com/Microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.bat
./vcpkg/vcpkg.exe --version
test -d vcpkg-binary-cache || mkdir vcpkg-binary-cache
- name: Cache Vcpkg Dependencies
uses: actions/cache@v3
with:
key: ${{matrix.config.preset}}
path: C:\vcpkg-binary-cache
- name: Configure
env:
VCPKG_ROOT: C:\vcpkg
VCPKG_DEFAULT_BINARY_CACHE: C:\vcpkg-binary-cache
run: cmake -S . --preset ${{matrix.config.preset}}
- name: Build
run: cmake --build --preset ${{matrix.config.preset}}
- name: Test
run: |
ctest --preset windows-tests