-
Notifications
You must be signed in to change notification settings - Fork 10
99 lines (88 loc) · 2.78 KB
/
ci-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
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
name: CI testing
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
linux-build:
name: 'Linux ${{matrix.cc.cc}}-${{ matrix.cc.v}} ${{matrix.build_type}}'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build_type:
- RelWithDebInfo
- Debug
cc:
- { cc: gcc, v: 9, cxx: g++}
- { cc: gcc, v: 13, cxx: g++}
- { cc: clang, v: 11, cxx: clang++ }
- { cc: clang, v: 16, cxx: clang++ }
env:
cc: ${{matrix.cc.cc}}-${{matrix.cc.v}}
cxx: ${{matrix.cc.cxx}}-${{matrix.cc.v}}
steps:
- uses: actions/checkout@v2
- name: Install packages
run: |
sudo apt update
sudo apt install cmake cmake-data build-essential libboost-all-dev
if [ "${{ matrix.cc.cc }}" == "gcc" ] ;
then
sudo apt install ${{matrix.cc.cc}}-${{matrix.cc.v}} ${{matrix.cc.cxx}}-${{matrix.cc.v}}
else
sudo apt install ${{matrix.cc.cc}}-${{matrix.cc.v}}
fi
- name: CMake Build
run: |
export CC=${{env.cc}}
export CXX=${{env.cxx}}
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}
- name: Test
working-directory: ${{github.workspace}}/build
run: |
ctest -C ${{ matrix.build_type }} -VV --timeout 30
macos-build:
name: 'OSX ${{matrix.cc.cc}}@${{matrix.cc.v || matrix.cc.xcode}} ${{matrix.build_type}}'
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
build_type:
- RelWithDebInfo
- Debug
cc:
- { cc: gcc, v: 12, cxx: g++, xcode: latest }
- { cc: clang, cxx: clang++, xcode: 12.0 }
- { cc: clang, cxx: clang++, xcode: 14.0 }
env:
cc: ${{matrix.cc.cc}}-${{matrix.cc.v}}
cxx: ${{matrix.cc.cxx}}-${{matrix.cc.v}}
steps:
- uses: actions/checkout@v2
- name: Install packages
run: |
brew update
if ["${{matrix.cc.cc}}" == "gcc"];
then
brew install ${{matrix.cc.cc}}@${{matrix.cc.v}}
fi
brew install boost
- name: CMake Build
run: |
if [ "${{ matrix.cc.cc }}" == "gcc" ] ;
then
export CC=/usr/bin/${{matrix.cc.cc}}
export CXX=/usr/bin/${{matrix.cc.cxx}}
else
export CC=${{matrix.cc.cc}}
export CXX=${{matrix.cc.cxx}}
fi
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}
- name: Test
working-directory: ${{github.workspace}}/build
run: |
ctest -C ${{ matrix.build_type }} -VV --timeout 30