-
Notifications
You must be signed in to change notification settings - Fork 0
182 lines (145 loc) · 4.95 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
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: Build
on: [push, pull_request]
jobs:
GCC:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
gcc: [12, 13, 14]
name: GCC-${{matrix.gcc}}
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build gcc-${{matrix.gcc}} g++-${{matrix.gcc}}
- name: Build
run: >
./build.sh
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=gcc-${{matrix.gcc}}
-DCMAKE_CXX_COMPILER=g++-${{matrix.gcc}}
-Dpapilio_build_unit_test=1
-Dpapilio_build_example=1
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest
- name: Display Infomation
working-directory: ${{github.workspace}}/build/example
run: ./info
- name: Install
working-directory: ${{github.workspace}}/build
run: sudo cmake --install .
- name: Test Installation
run: |
cmake -GNinja -S test/test_install/ -B build/papilio_test_install -DCMAKE_CXX_COMPILER=g++-${{matrix.gcc}}
cmake --build build/papilio_test_install
build/papilio_test_install/papilio_test_install
- name: Test add_subdirectory
run: |
cmake -GNinja -S test/test_subdir/ -B build/papilio_test_subdir -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-${{matrix.gcc}}
cmake --build build/papilio_test_subdir
build/papilio_test_subdir/papilio_test_subdir
Clang:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
clang: [15, 16, 17]
stdlib: ["libstdc++", "libc++"]
exclude:
# Clang 15 does not fully support some features used by libstdc++
- clang: 15
stdlib: "libstdc++"
name: Clang-${{matrix.clang}} ${{matrix.stdlib}}
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build clang-${{matrix.clang}}
- name: Install libc++
if: ${{matrix.stdlib == 'libc++'}}
run: |
sudo apt-get install -y libc++-${{matrix.clang}}-dev libc++abi-${{matrix.clang}}-dev
- name: Build
run: >
./build.sh
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=clang-${{matrix.clang}}
-DCMAKE_CXX_COMPILER=clang++-${{matrix.clang}}
-Dpapilio_build_unit_test=1
-Dpapilio_build_example=1
${{matrix.stdlib == 'libc++' && '-Dpapilio_use_libcpp=1'}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest
- name: Display Infomation
working-directory: ${{github.workspace}}/build/example
run: ./info
MSVC:
runs-on: windows-2022
name: MSVC
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- name: Build
run: >
./build.ps1
-DCMAKE_BUILD_TYPE=Release
-Dpapilio_build_unit_test=1
-Dpapilio_build_example=1
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest
- name: Display Infomation
working-directory: ${{github.workspace}}/build/example
run: .\info.exe
ClangCl:
runs-on: windows-2022
name: ClangCl
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
# Workaround
# See https://github.com/actions/runner-images/issues/10001
- name: Workaround
run: choco upgrade llvm
- name: Build
run: >
./build.ps1
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=clang-cl
-DCMAKE_CXX_COMPILER=clang-cl
-Dpapilio_build_unit_test=1
-Dpapilio_build_example=1
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest
- name: Display Infomation
working-directory: ${{github.workspace}}/build/example
run: .\info.exe
Doxygen:
needs: [GCC, Clang]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build doxygen graphviz
- name: Build
working-directory: ${{github.workspace}}
run: |
mkdir -pv build
cmake -GNinja -S . -B build -Dpapilio_build_doc=1 -Dpapilio_build_lib=0
cmake --build build --target papilio_doc
- uses: actions/upload-artifact@v4
with:
name: papilio-doc
path: ${{github.workspace}}/build/doxygen_output