141 lines (141 loc) · 4.6 KB
/
linux-nondefault.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Linux build with non-default configuration
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: "gcc 5.4 (Boost 1.66)"
shortname: gcc5
tag: xenial
cc: gcc
cxx: g++
- name: "gcc 6.3 (Boost 1.66)"
shortname: gcc6
tag: zesty
cc: gcc
cxx: g++
- name: "gcc 7.4 (Boost 1.72)"
shortname: gcc7
tag: bionic
cc: gcc
cxx: g++
- name: "gcc 8.3 (Boost 1.72)"
shortname: gcc8
tag: cosmic
cc: gcc
cxx: g++
- name: "gcc 9.x"
shortname: gcc9
tag: focal
cc: gcc
cxx: g++
- name: "gcc 10.x"
shortname: gcc10
tag: groovy
cc: gcc
cxx: g++
- name: "Clang 6 (Boost 1.72)"
shortname: clang6
tag: bionic
cc: clang
cxx: clang++
- name: "Clang 7 (Boost 1.72)"
shortname: clang7
tag: cosmic
cc: clang
cxx: clang++
- name: "Clang 8 (Boost 1.72)"
shortname: clang8
tag: disco
cc: clang
cxx: clang++
- name: "Clang 9 (Boost 1.74)"
shortname: clang9
tag: eoan
cc: clang
cxx: clang++
- name: "Clang 10"
shortname: clang10
tag: focal
cc: clang
cxx: clang++
- name: "Clang 11"
shortname: clang11
tag: groovy
cc: clang
cxx: clang++
- name: "Clang 12"
shortname: clang12
tag: hirsute
cc: clang
cxx: clang++
- name: "C++11 mode"
shortname: c++11
tag: rolling
cc: gcc
cxx: g++
cxxflags: "-std=c++11"
- name: "C++14 mode"
shortname: c++14
tag: rolling
cc: gcc
cxx: g++
cxxflags: "-std=c++14"
- name: "C++17 mode"
shortname: c++17
tag: rolling
cc: gcc
cxx: g++
cxxflags: "-std=c++17"
- name: "C++20 mode"
shortname: c++20
tag: rolling
cc: gcc
cxx: g++
cxxflags: "-std=c++20"
- name: "Unity build enabled"
shortname: unity
tag: rolling
cc: gcc
cxx: g++
configureflags: --enable-unity-build
- name: "C++11 classes enabled"
shortname: stdclasses
tag: rolling
cc: gcc
cxx: g++
cxxflags: "-std=c++17"
configureflags: --enable-std-classes
container: ghcr.io/lballabio/quantlib-devenv:${{ matrix.tag }}
steps:
- uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
with:
path: ~/.ccache
key: linux-nondef-build-${{ matrix.shortname }}-${{ github.ref }}-${{ github.head_ref }}-${{ hashFiles('**/*.hpp', '**/*.cpp') }}
restore-keys: |
linux-nondef-build-${{ matrix.shortname }}-${{ github.ref }}-${{ github.head_ref }}-
linux-nondef-build-${{ matrix.shortname }}-${{ github.ref }}-
linux-nondef-build-${{ matrix.shortname }}-refs/heads/master-
linux-nondef-build-${{ matrix.shortname }}-
- name: Build
run: |
./autogen.sh
./configure --disable-static --enable-error-lines --enable-error-functions --enable-tracing --enable-indexed-coupons --enable-extra-safety-checks --enable-sessions --enable-thread-safe-observer-pattern --enable-intraday ${{ matrix.configureflags }} CC="ccache ${{ matrix.cc }}" CXX="ccache ${{ matrix.cxx }}" CXXFLAGS="-O2 -g0 -Wall -Wno-unknown-pragmas -Werror ${{ matrix.cxxflags }}"
make -j 2
- name: Run tests
run: |
./test-suite/quantlib-test-suite --log_level=message
- name: Run examples
run: |
make check-examples
- name: Check global header
run: |
echo "#include <ql/quantlib.hpp>" > test1.cpp && echo "int main() { return 0; }" >> test1.cpp
echo "#include <ql/quantlib.hpp>" > test2.cpp && echo "namespace QuantLib { ThreadKey sessionId() { return 0; } }" >> test2.cpp
make install
${{ matrix.cxx }} -O2 -g0 -Wall -Wno-unknown-pragmas -Werror ${{ matrix.cxxflags }} test1.cpp test2.cpp -lQuantLib -lboost_thread -lboost_system -pthread