Repository navigation
77 lines (66 loc) · 1.96 KB
/
Copy pathbuild.yml
File metadata and controls
77 lines (66 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Build and Test ldsCtrlEst
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up dependencies for macOS and Linux
if: runner.os != 'Windows'
run: |
if [ "${{ runner.os }}" == "macOS" ]; then
brew install ninja
elif [ "${{ runner.os }}" == "Linux" ]; then
sudo apt-get update
sudo apt-get install -y build-essential
fi
- name: Run vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgJsonGlob: 'vcpkg.json'
runVcpkgInstall: true
- name: Cache build directory
uses: actions/cache@v3
with:
path: build
key: build-${{ matrix.os }}-${{ hashFiles('CMakeLists.txt') }}
restore-keys: |
build-${{ matrix.os }}-
- name: Configure and build for macOS/Linux
if: runner.os != 'Windows'
uses: lukka/run-cmake@v10
with:
cmakeListsTxtPath: CMakeLists.txt
configurePreset: 'linux-release'
buildPreset: 'linux-release'
cmakeVersion: '3.31.6'
- name: Configure and build for Windows
if: runner.os == 'Windows'
uses: lukka/run-cmake@v10
with:
cmakeListsTxtPath: CMakeLists.txt
configurePreset: 'windows-release'
buildPreset: 'windows-release'
buildPresetAdditionalArgs: "['--config Release']"
cmakeVersion: '3.31.6'
- name: Install and Update PATH (Windows only)
if: runner.os == 'Windows'
run: |
cd build
cmake --install .
echo "${{github.workspace}}/install/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Run tests
run: |
cd build
ctest -C Release