-
Notifications
You must be signed in to change notification settings - Fork 2
100 lines (90 loc) · 2.77 KB
/
main.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Build
on:
push:
pull_request:
workflow_dispatch:
inputs:
WITH_TOOLS:
description: Compile with tools
required: true
default: '1'
WITH_EXAMPLES:
description: Compile with examples
required: true
default: '1'
env:
WITH_TOOLS: ${{ github.event.inputs.WITH_TOOLS || '1' }}
WITH_EXAMPLES: ${{ github.event.inputs.WITH_EXAMPLES || '1' }}
BUILD_TYPE: Release
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- name: Ubuntu GCC
os: ubuntu-latest
compiler: gcc
version: 9
cc: gcc
cxx: g++
generator: Unix Makefiles
- name: Ubuntu Clang
os: ubuntu-latest
compiler: clang
version: 11
cc: clang
cxx: clang++
generator: Unix Makefiles
- name: Windows Latest MSVC
os: windows-latest
compiler: Visual Studio
version: 17
cc: cl
cxx: cl
generator: Visual Studio 17 2022
# - name: Window Latest MinGW
# os: windows-latest
# compiler: gcc
# version: 11.2
# cc: gcc
# cxx: g++
# generator: MinGW Makefiles
steps:
- name: Checking out repostitory
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Conan
uses: turtlebrowser/get-conan@main
- name: Create default Conan profile
run: |
conan profile new default --detect
conan profile update settings.compiler='${{matrix.config.compiler}}' default
conan profile update settings.compiler.version=${{matrix.config.version}} default
- name: Config LIBCXX
if: ${{matrix.config.name != 'Windows Latest MSVC'}}
run: conan profile update settings.compiler.libcxx=libstdc++11 default
- name: Conan install dependencies
run: >
conan install .
-s build_type=${{env.BUILD_TYPE}}
-if ${{github.workspace}}/build
-pr default
-b missing
- name: CMake configure
run: >
cmake -G "${{matrix.config.generator}}"
-DCMAKE_C_COMPILER=${{matrix.config.cc}}
-DCMAKE_CXX_COMPILER=${{matrix.config.cxx}}
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-DWITH_TOOLS=${{github.event.inputs.WITH_TOOLS}}
-DWITH_EXAMPLES=${{github.event.inputs.WITH_EXAMPLES}}
-B ${{github.workspace}}/build
- name: Build library
run: >
cmake
--build ${{github.workspace}}/build
--config ${{env.BUILD_TYPE}}