forked from libsndfile/libsndfile
-
Notifications
You must be signed in to change notification settings - Fork 2
238 lines (216 loc) · 7.84 KB
/
action.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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
name: C/C++ CI
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
name: [
ubuntu-gcc-autotools,
ubuntu-clang-autotools,
ubuntu-gcc-ossfuzz,
macos-autotools,
ubuntu-gcc-cmake,
ubuntu-gcc-cmake-shared,
ubuntu-clang-cmake,
ubuntu-clang-cmake-shared,
macos-cmake,
macos-cmake-shared,
windows-vs2022-x64,
windows-vs2022-x64-shared,
windows-vs2022-Win32,
windows-vs2022-Win32-shared
]
include:
- name: ubuntu-gcc-autotools
os: ubuntu-latest
cc: gcc
cxx: g++
autotools-options: --enable-werror
build-system: autotools
- name: ubuntu-clang-autotools
os: ubuntu-latest
cc: clang
cxx: clang++
autotools-options: --enable-werror
build-system: autotools
- name: ubuntu-gcc-ossfuzz
os: ubuntu-latest
cc: gcc
cxx: g++
autotools-options: --enable-werror
build-system: ossfuzz
- name: macos-autotools
os: macos-latest
cc: clang
cxx: clang++
autotools-options: --enable-werror
build-system: autotools
- name: ubuntu-gcc-cmake
os: ubuntu-latest
cc: gcc
cxx: g++
build-system: cmake
cmake-generator: 'Ninja'
cmake-options: >-
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_FLAGS="-Wall -Wextra"
-DCMAKE_VERBOSE_MAKEFILE=ON
- name: ubuntu-gcc-cmake-shared
os: ubuntu-latest
cc: gcc
cxx: g++
build-system: cmake
cmake-generator: 'Ninja'
cmake-options: >-
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SHARED_LIBS=ON
-DCMAKE_C_FLAGS="-Wall -Wextra"
-DCMAKE_VERBOSE_MAKEFILE=ON
- name: ubuntu-clang-cmake
os: ubuntu-latest
cc: clang
cxx: clang++
build-system: cmake
cmake-generator: 'Ninja'
cmake-options: >-
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_FLAGS="-Wall -Wextra"
-DCMAKE_VERBOSE_MAKEFILE=ON
- name: ubuntu-clang-cmake-shared
os: ubuntu-latest
cc: clang
cxx: clang++
build-system: cmake
cmake-generator: 'Ninja'
cmake-options: >-
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SHARED_LIBS=ON
-DCMAKE_C_FLAGS="-Wall -Wextra"
-DCMAKE_VERBOSE_MAKEFILE=ON
- name: macos-cmake
os: macos-latest
cc: clang
cxx: clang++
build-system: cmake
cmake-generator: 'Unix Makefiles'
cmake-options: >-
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_FLAGS="-Wall -Wextra"
-DCMAKE_VERBOSE_MAKEFILE=ON
- name: macos-cmake-shared
os: macos-latest
cc: clang
cxx: clang++
build-system: cmake
cmake-generator: 'Unix Makefiles'
cmake-options: >-
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SHARED_LIBS=ON
-DCMAKE_C_FLAGS="-Wall -Wextra"
-DCMAKE_VERBOSE_MAKEFILE=ON
- name: windows-vs2022-x64
os: windows-latest
triplet: 'x64-windows-static'
build-system: cmake
cmake-generator: 'Visual Studio 17 2022'
cmake-options: >-
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>
-DCMAKE_BUILD_TYPE=Release
-DVCPKG_TARGET_TRIPLET=x64-windows-static
-DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake
- name: windows-vs2022-x64-shared
os: windows-latest
triplet: 'x64-windows-static'
build-system: cmake
cmake-generator: 'Visual Studio 17 2022'
cmake-options: >-
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>
-DBUILD_SHARED_LIBS=ON
-DBUILD_REGTEST=OFF
-DBUILD_EXAMPLES=OFF
-DINSTALL_PKGCONFIG_MODULE=OFF
-DCMAKE_BUILD_TYPE=Release
-DVCPKG_TARGET_TRIPLET=x64-windows-static
-DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake
- name: windows-vs2022-Win32
os: windows-latest
triplet: 'x86-windows-static'
build-system: cmake
cmake-generator: 'Visual Studio 17 2022'
cmake-options: >-
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>
-DCMAKE_GENERATOR_PLATFORM=Win32
-DCMAKE_BUILD_TYPE=Release
-DVCPKG_TARGET_TRIPLET=x86-windows-static
-DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake
- name: windows-vs2022-Win32-shared
os: windows-latest
triplet: 'x86-windows-static'
build-system: cmake
cmake-generator: 'Visual Studio 17 2022'
cmake-options: >-
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>
-DCMAKE_GENERATOR_PLATFORM=Win32
-DBUILD_SHARED_LIBS=ON
-DBUILD_REGTEST=OFF
-DBUILD_EXAMPLES=OFF
-DINSTALL_PKGCONFIG_MODULE=OFF
-DCPACK_PACKAGE_NAME=libsndfile
-DCMAKE_BUILD_TYPE=Release
-DVCPKG_TARGET_TRIPLET=x86-windows-static
-DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install MacOS dependencies
if: startsWith(matrix.os,'macos')
run: |
brew install automake autogen speex mpg123
- name: Install Linux dependencies
if: startsWith(matrix.os,'ubuntu')
run: sudo apt-get update -y && sudo apt-get install -y autogen ninja-build libogg-dev libvorbis-dev libflac-dev libopus-dev libasound2-dev libsqlite3-dev libspeex-dev libmp3lame-dev libmpg123-dev
- name: Setup NuGet Credentials
env:
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
if: startsWith(matrix.os,'windows')
shell: 'bash'
run: >
`vcpkg fetch nuget | tail -n 1`
sources add
-source "https://nuget.pkg.github.com/libsndfile/index.json"
-storepasswordincleartext
-name "GitHub"
-username "evpobr"
-password "${{ secrets.GITHUB_TOKEN }}"
- name: Configure, build and test with Autotools
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
if: startsWith(matrix.build-system,'autotools')
run: |
autoreconf -vif
if [[ "${CC}" == "clang" ]]; then
./configure --enable-werror && make distcheck
else
Scripts/asan-configure.sh --enable-werror && make distcheck
fi
- name: Configure, build and test with CMake
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
if: startsWith(matrix.build-system,'cmake')
run: |
mkdir build
cd build
cmake .. -G "${{matrix.cmake-generator}}" ${{matrix.cmake-options}}
cmake --build . --config Release
ctest
- name: Configure, build and test with OSSFuzz
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
if: startsWith(matrix.build-system,'ossfuzz')
run: |
./ossfuzz/ci_oss.sh