Skip to content

Commit 0639b89

Browse files
committed
Adding cmake build job
1 parent 006229a commit 0639b89

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/csharp-cmake.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: C# Build with CMake
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Cache NuGet packages
19+
uses: actions/cache@v3
20+
with:
21+
path: ~/.nuget/packages
22+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
23+
restore-keys: |
24+
${{ runner.os }}-nuget-
25+
26+
- name: Cache CMake build
27+
uses: actions/cache@v3
28+
with:
29+
path: build
30+
key: ${{ runner.os }}-cmake-${{ hashFiles('CMakeLists.txt') }}
31+
restore-keys: |
32+
${{ runner.os }}-cmake-
33+
34+
- name: Setup .NET
35+
uses: actions/setup-dotnet@v3
36+
with:
37+
dotnet-version: '8.0.x'
38+
39+
- name: Install CMake
40+
uses: lukka/get-cmake@latest
41+
42+
- name: Create Build Directory
43+
run: mkdir -p build
44+
45+
- name: Configure CMake
46+
run: cmake -S . -B build
47+
48+
- name: Build
49+
run: cmake --build build --config Release
50+
51+
- name: Test
52+
run: |
53+
cd build
54+
ctest -C Release --output-on-failure

0 commit comments

Comments
 (0)