-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (65 loc) · 2.21 KB
/
build.yml
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
name: ci
on:
pull_request:
release:
types: [published]
push:
tags:
branches:
- main
- master
jobs:
Test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
#- macos-latest
#- windows-2022
compiler:
# you can specify the version after `-` like "llvm-15.0.2".
- llvm-17
#- gcc-14.1 not downloadable yet. 14 is required for module support
generator:
- "Ninja Multi-Config"
build_type:
- Release
include:
# Windows msvc builds
- os: windows-latest
compiler: msvc
generator: "Visual Studio 17 2022"
build_type: Release
steps:
- uses: actions/checkout@v4
- name: Install dependencies (linux)
run: sudo apt install ninja-build libopencv-dev libpoco-dev
if: matrix.os == 'ubuntu-latest'
- name: Install dependencies (windows)
run: |
choco install opencv --package-parameters '/InstallationPath:C:\opencv /Environment'
echo "C:\opencv\opencv\build\x64\vc16\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
if: matrix.os == 'windows-latest'
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows' )}}
ninja: 1.12.1
cmake: 3.29.2
- name: Configure CMake (windows)
run: |
cmake -S . -B ./build -G "${{matrix.generator}}" -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -DOpenCV_DIR="C:/opencv/opencv/build/"
if: matrix.os == 'windows-latest'
- name: Configure CMake (linux)
run: |
cmake -S . -B ./build -G "${{matrix.generator}}" -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}}
if: matrix.os == 'ubuntu-latest'
- name: Build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
cmake --build ./build --config ${{matrix.build_type}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --output-on-failure