Skip to content

20 add cmake

20 add cmake #1

Workflow file for this run

name: C# Build with CMake
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache NuGet packages
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Cache CMake build
uses: actions/cache@v3
with:
path: build
key: ${{ runner.os }}-cmake-${{ hashFiles('CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-cmake-
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Install CMake
uses: lukka/get-cmake@latest
- name: Create Build Directory
run: mkdir -p build
- name: Configure CMake
run: cmake -S . -B build
- name: Build
run: cmake --build build --config Release
- name: Test
run: |
cd build
ctest -C Release --output-on-failure