Skip to content

ci: refactor

ci: refactor #43

Workflow file for this run

name: CMake
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
linux:
strategy:
fail-fast: false
matrix:
config:
- preset: linux-x64-debug
runs-on: ubunutu-20.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: ${{github.workspace}}/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:
# matrix:
# config:
# - windows-x64-debug
# - windows-x64-release
# runs-on: ${{matrix.config.os}}
# steps:
# - name: Prepare
# uses: actions/checkout@v3
# - name: Setup vcpkg
# working-directory: ${{github.workspace}}
# run: |
# git clone https://github.com/Microsoft/vcpkg.git
# cd vcpkg
# ./bootstrap-vcpkg.bat
# ./vcpkg.exe --version
# cd ..