Skip to content

Commit ccb0746

Browse files
committed
Add matrix build setup
Signed-off-by: Pierre R. Mai <pmai@pmsf.de>
1 parent c5bc9f0 commit ccb0746

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

.github/workflows/build.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI Builds
2+
3+
on:
4+
# execute on every PR made targeting the branches bellow
5+
pull_request:
6+
branches:
7+
- main
8+
9+
# execute on every push
10+
push:
11+
12+
jobs:
13+
build-cpp:
14+
name: Build CPP Bindings
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [windows-latest, ubuntu-latest, macos-latest]
19+
runs-on: ${{ matrix.os }}
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
submodules: true
25+
26+
- name: Get CMake
27+
uses: lukka/get-cmake@latest
28+
29+
- name: Cache vcpkg
30+
uses: actions/cache@v4
31+
with:
32+
path: ${{ github.workspace }}/vcpkg_cache
33+
key: vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json', 'CMakePresets.json') }}
34+
35+
- name: Setup vcpkg
36+
uses: lukka/run-vcpkg@v11
37+
38+
- name: Build bindings
39+
uses: lukka/run-cmake@v10
40+
env:
41+
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
42+
with:
43+
configurePreset: vcpkg
44+
buildPreset: vcpkg
45+
buildPresetAdditionalArgs: "['--config Release']"

CMakePresets.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,15 @@
1515
"VCPKG_TARGET_TRIPLET": "x64-windows-static-md"
1616
}
1717
}
18+
],
19+
"buildPresets": [
20+
{
21+
"name": "vcpkg",
22+
"configurePreset": "vcpkg"
23+
},
24+
{
25+
"name": "vcpkg-windows",
26+
"configurePreset": "vcpkg-windows"
27+
}
1828
]
1929
}

0 commit comments

Comments
 (0)