2020-08-03 05:03:22 +00:00
|
|
|
name: C/C++ CI
|
|
|
|
|
2020-08-20 07:41:00 +00:00
|
|
|
on: [push, pull_request]
|
2020-08-03 05:03:22 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
2020-08-25 11:26:20 +00:00
|
|
|
fail-fast: false
|
2020-08-03 05:03:22 +00:00
|
|
|
matrix:
|
|
|
|
name: [
|
2020-08-28 07:32:54 +00:00
|
|
|
ubuntu-gcc-autotools,
|
|
|
|
ubuntu-clang-autotools,
|
2019-07-27 19:44:18 +00:00
|
|
|
ubuntu-gcc-ossfuzz,
|
2020-08-28 07:32:54 +00:00
|
|
|
macos-autotools,
|
|
|
|
ubuntu-gcc-cmake,
|
|
|
|
ubuntu-gcc-cmake-shared,
|
|
|
|
ubuntu-clang-cmake,
|
|
|
|
ubuntu-clang-cmake-shared,
|
|
|
|
macos-cmake,
|
|
|
|
macos-cmake-shared,
|
2022-04-18 08:42:20 +00:00
|
|
|
windows-vs2022-x64,
|
|
|
|
windows-vs2022-x64-shared,
|
|
|
|
windows-vs2022-Win32,
|
|
|
|
windows-vs2022-Win32-shared
|
2020-08-03 05:03:22 +00:00
|
|
|
]
|
|
|
|
include:
|
2020-08-28 07:32:54 +00:00
|
|
|
- name: ubuntu-gcc-autotools
|
2020-08-03 05:03:22 +00:00
|
|
|
os: ubuntu-latest
|
|
|
|
cc: gcc
|
|
|
|
cxx: g++
|
2019-02-10 06:45:55 +00:00
|
|
|
autotools-options: --enable-werror
|
2020-08-03 05:03:22 +00:00
|
|
|
build-system: autotools
|
|
|
|
|
2020-08-28 07:32:54 +00:00
|
|
|
- name: ubuntu-clang-autotools
|
2020-08-03 05:03:22 +00:00
|
|
|
os: ubuntu-latest
|
|
|
|
cc: clang
|
|
|
|
cxx: clang++
|
2019-02-10 06:45:55 +00:00
|
|
|
autotools-options: --enable-werror
|
2020-08-03 05:03:22 +00:00
|
|
|
build-system: autotools
|
|
|
|
|
2019-07-27 19:44:18 +00:00
|
|
|
- name: ubuntu-gcc-ossfuzz
|
|
|
|
os: ubuntu-latest
|
|
|
|
cc: gcc
|
|
|
|
cxx: g++
|
2019-02-10 06:45:55 +00:00
|
|
|
autotools-options: --enable-werror
|
2019-07-27 19:44:18 +00:00
|
|
|
build-system: ossfuzz
|
|
|
|
|
2020-08-28 07:32:54 +00:00
|
|
|
- name: macos-autotools
|
2020-08-03 05:03:22 +00:00
|
|
|
os: macos-latest
|
|
|
|
cc: clang
|
|
|
|
cxx: clang++
|
2019-02-10 06:45:55 +00:00
|
|
|
autotools-options: --enable-werror
|
2020-08-03 05:03:22 +00:00
|
|
|
build-system: autotools
|
|
|
|
|
2020-08-28 07:32:54 +00:00
|
|
|
- name: ubuntu-gcc-cmake
|
2020-08-03 05:03:22 +00:00
|
|
|
os: ubuntu-latest
|
|
|
|
cc: gcc
|
|
|
|
cxx: g++
|
|
|
|
build-system: cmake
|
|
|
|
cmake-generator: 'Ninja'
|
2020-08-28 07:53:40 +00:00
|
|
|
cmake-options: >-
|
|
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
|
|
-DCMAKE_C_FLAGS="-Wall -Wextra"
|
|
|
|
-DCMAKE_VERBOSE_MAKEFILE=ON
|
2020-08-03 05:03:22 +00:00
|
|
|
|
2020-08-28 07:32:54 +00:00
|
|
|
- name: ubuntu-gcc-cmake-shared
|
2020-08-28 07:28:40 +00:00
|
|
|
os: ubuntu-latest
|
|
|
|
cc: gcc
|
|
|
|
cxx: g++
|
|
|
|
build-system: cmake
|
|
|
|
cmake-generator: 'Ninja'
|
2020-08-28 07:53:40 +00:00
|
|
|
cmake-options: >-
|
|
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
|
|
-DBUILD_SHARED_LIBS=ON
|
|
|
|
-DCMAKE_C_FLAGS="-Wall -Wextra"
|
|
|
|
-DCMAKE_VERBOSE_MAKEFILE=ON
|
2020-08-28 07:28:40 +00:00
|
|
|
|
2020-08-28 07:32:54 +00:00
|
|
|
- name: ubuntu-clang-cmake
|
2020-08-03 05:03:22 +00:00
|
|
|
os: ubuntu-latest
|
|
|
|
cc: clang
|
|
|
|
cxx: clang++
|
|
|
|
build-system: cmake
|
|
|
|
cmake-generator: 'Ninja'
|
2020-08-28 07:53:40 +00:00
|
|
|
cmake-options: >-
|
|
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
|
|
-DCMAKE_C_FLAGS="-Wall -Wextra"
|
|
|
|
-DCMAKE_VERBOSE_MAKEFILE=ON
|
2020-08-03 05:03:22 +00:00
|
|
|
|
2020-08-28 07:32:54 +00:00
|
|
|
- name: ubuntu-clang-cmake-shared
|
2020-08-28 07:28:40 +00:00
|
|
|
os: ubuntu-latest
|
|
|
|
cc: clang
|
|
|
|
cxx: clang++
|
|
|
|
build-system: cmake
|
|
|
|
cmake-generator: 'Ninja'
|
2020-08-28 07:53:40 +00:00
|
|
|
cmake-options: >-
|
|
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
|
|
-DBUILD_SHARED_LIBS=ON
|
|
|
|
-DCMAKE_C_FLAGS="-Wall -Wextra"
|
|
|
|
-DCMAKE_VERBOSE_MAKEFILE=ON
|
2020-08-28 07:28:40 +00:00
|
|
|
|
2020-08-28 07:32:54 +00:00
|
|
|
- name: macos-cmake
|
2020-08-03 05:03:22 +00:00
|
|
|
os: macos-latest
|
|
|
|
cc: clang
|
|
|
|
cxx: clang++
|
|
|
|
build-system: cmake
|
|
|
|
cmake-generator: 'Unix Makefiles'
|
2020-08-28 07:53:40 +00:00
|
|
|
cmake-options: >-
|
|
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
|
|
-DCMAKE_C_FLAGS="-Wall -Wextra"
|
|
|
|
-DCMAKE_VERBOSE_MAKEFILE=ON
|
2020-08-03 05:03:22 +00:00
|
|
|
|
2020-08-28 07:32:54 +00:00
|
|
|
- name: macos-cmake-shared
|
2020-08-28 07:28:40 +00:00
|
|
|
os: macos-latest
|
|
|
|
cc: clang
|
|
|
|
cxx: clang++
|
|
|
|
build-system: cmake
|
|
|
|
cmake-generator: 'Unix Makefiles'
|
2020-08-28 07:53:40 +00:00
|
|
|
cmake-options: >-
|
|
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
|
|
-DBUILD_SHARED_LIBS=ON
|
|
|
|
-DCMAKE_C_FLAGS="-Wall -Wextra"
|
|
|
|
-DCMAKE_VERBOSE_MAKEFILE=ON
|
2020-08-28 07:28:40 +00:00
|
|
|
|
2022-04-18 08:42:20 +00:00
|
|
|
- name: windows-vs2022-x64
|
2020-08-03 05:03:22 +00:00
|
|
|
os: windows-latest
|
|
|
|
triplet: 'x64-windows-static'
|
|
|
|
build-system: cmake
|
2022-04-18 08:42:20 +00:00
|
|
|
cmake-generator: 'Visual Studio 17 2022'
|
2020-08-28 07:53:40 +00:00
|
|
|
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
|
2020-08-03 05:03:22 +00:00
|
|
|
|
2022-04-18 08:42:20 +00:00
|
|
|
- name: windows-vs2022-x64-shared
|
2020-08-28 07:28:40 +00:00
|
|
|
os: windows-latest
|
|
|
|
triplet: 'x64-windows-static'
|
|
|
|
build-system: cmake
|
2022-04-18 08:42:20 +00:00
|
|
|
cmake-generator: 'Visual Studio 17 2022'
|
2020-08-28 07:53:40 +00:00
|
|
|
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
|
2020-08-28 07:28:40 +00:00
|
|
|
|
2022-04-18 08:42:20 +00:00
|
|
|
- name: windows-vs2022-Win32
|
2020-08-03 05:03:22 +00:00
|
|
|
os: windows-latest
|
|
|
|
triplet: 'x86-windows-static'
|
|
|
|
build-system: cmake
|
2022-04-18 08:42:20 +00:00
|
|
|
cmake-generator: 'Visual Studio 17 2022'
|
2020-08-28 07:53:40 +00:00
|
|
|
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
|
2020-08-03 05:03:22 +00:00
|
|
|
|
2022-04-18 08:42:20 +00:00
|
|
|
- name: windows-vs2022-Win32-shared
|
2020-08-28 07:28:40 +00:00
|
|
|
os: windows-latest
|
|
|
|
triplet: 'x86-windows-static'
|
|
|
|
build-system: cmake
|
2022-04-18 08:42:20 +00:00
|
|
|
cmake-generator: 'Visual Studio 17 2022'
|
2020-08-28 07:53:40 +00:00
|
|
|
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
|
2020-08-28 07:28:40 +00:00
|
|
|
|
2019-07-27 19:44:18 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2020-08-03 05:03:22 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install MacOS dependencies
|
|
|
|
if: startsWith(matrix.os,'macos')
|
|
|
|
run: |
|
2019-02-10 06:45:55 +00:00
|
|
|
brew install automake autogen speex mpg123
|
2020-08-03 05:03:22 +00:00
|
|
|
|
2019-02-10 06:45:55 +00:00
|
|
|
- name: Install Linux dependencies
|
2020-08-03 05:03:22 +00:00
|
|
|
if: startsWith(matrix.os,'ubuntu')
|
2021-05-12 04:03:44 +00:00
|
|
|
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
|
2020-08-03 05:03:22 +00:00
|
|
|
|
2021-11-21 13:47:22 +00:00
|
|
|
- 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 }}"
|
|
|
|
|
2020-08-03 05:03:22 +00:00
|
|
|
- name: Configure, build and test with Autotools
|
|
|
|
env:
|
|
|
|
CC: ${{ matrix.cc }}
|
|
|
|
CXX: ${{ matrix.cxx }}
|
|
|
|
if: startsWith(matrix.build-system,'autotools')
|
|
|
|
run: |
|
2022-09-24 10:51:49 +00:00
|
|
|
autoreconf -vif
|
2020-08-03 05:03:22 +00:00
|
|
|
if [[ "${CC}" == "clang" ]]; then
|
2021-03-07 06:37:19 +00:00
|
|
|
./configure --enable-werror && make distcheck
|
2020-08-03 05:03:22 +00:00
|
|
|
else
|
2021-03-07 06:37:19 +00:00
|
|
|
Scripts/asan-configure.sh --enable-werror && make distcheck
|
2020-08-03 05:03:22 +00:00
|
|
|
fi
|
2019-07-27 19:44:18 +00:00
|
|
|
|
2020-08-03 05:03:22 +00:00
|
|
|
- name: Configure, build and test with CMake
|
|
|
|
env:
|
|
|
|
CC: ${{ matrix.cc }}
|
|
|
|
CXX: ${{ matrix.cxx }}
|
2021-11-21 13:47:22 +00:00
|
|
|
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
|
2020-08-03 05:03:22 +00:00
|
|
|
if: startsWith(matrix.build-system,'cmake')
|
|
|
|
run: |
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake .. -G "${{matrix.cmake-generator}}" ${{matrix.cmake-options}}
|
|
|
|
cmake --build . --config Release
|
|
|
|
ctest
|
2019-07-27 19:44:18 +00:00
|
|
|
|
|
|
|
- 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
|