Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Asteborg <xnorpx@outlook.com>2023-06-17 19:10:40 +0300
committerMarcus Asteborg <xnorpx@outlook.com>2023-06-21 15:59:37 +0300
commitacb67a873fb6b8c9d1498be4811c4943fb7929de (patch)
treeca98e027e19663855861a298fbd68d9c1698bcf5
parentf730f47a1190f9f587fb869e90f0f80c284da420 (diff)
CMake CI for Github actions
-rw-r--r--.github/workflows/cmake.yml258
1 files changed, 258 insertions, 0 deletions
diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml
new file mode 100644
index 00000000..78929739
--- /dev/null
+++ b/.github/workflows/cmake.yml
@@ -0,0 +1,258 @@
+name: CMake
+
+on: [push, pull_request]
+
+jobs:
+ CMakeVersionTest:
+ name: Test build with CMake 3.1.0
+ runs-on: ubuntu-20.04
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ - name: Pull git submodules
+ run: git submodule update --init --recursive
+ - name: Submodule init and Download models
+ run: ./autogen.sh
+ - name: Install CMake 3.1
+ run: |
+ curl -sL https://github.com/Kitware/CMake/releases/download/v3.1.0/cmake-3.1.0-Linux-x86_64.sh -o cmakeinstall.sh
+ chmod +x cmakeinstall.sh
+ sudo ./cmakeinstall.sh --prefix=/usr/local --exclude-subdir
+ rm cmakeinstall.sh
+ sudo apt-get install libidn11
+ - name: Create Work Dir
+ run: mkdir build
+ - name: Configure
+ working-directory: ./build
+ run: cmake .. -DOPUS_BUILD_PROGRAMS=ON -DBUILD_TESTING=ON
+ - name: Build
+ working-directory: ./build
+ run: make -j 2 -s
+ - name: Test
+ working-directory: ./build
+ run: ctest -j 2
+
+ CMakeMINGW:
+ name: CMake MINGW
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ - name: Pull git submodules
+ run: git submodule update --init --recursive
+ - name: Submodule init and Download models
+ run: ./autogen.sh
+ - name: Install MINGW
+ run: sudo apt-get install -y mingw-w64
+ - name: Create Work Dir
+ run: mkdir build
+ - name: Configure
+ working-directory: ./build
+ run: cmake .. -DOPUS_BUILD_PROGRAMS=ON -DBUILD_TESTING=ON -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc
+ - name: Build
+ working-directory: ./build
+ run: cmake --build . -j 2 --config Release --target package
+
+ CMakeBuild:
+ name: CMake/${{ matrix.config.name }}
+ runs-on: ${{ matrix.config.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ config:
+ - {
+ name: "Android/So/ARMv8/Release",
+ os: ubuntu-latest,
+ config: Release,
+ args: "-DCMAKE_TOOLCHAIN_FILE=${ANDROID_HOME}/ndk/25.2.9519653/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DBUILD_SHARED_LIBS=ON"
+ }
+ # TODO: Android ARMv7
+ # - {
+ # name: "Android/So/ARMv7/Release",
+ # os: ubuntu-latest,
+ # config: Release,
+ # args: "-DCMAKE_TOOLCHAIN_FILE=${ANDROID_HOME}/ndk/25.2.9519653/build/cmake/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DBUILD_SHARED_LIBS=ON"
+ # }
+ - {
+ name: "Android/So/X86/Release",
+ os: ubuntu-latest,
+ config: Release,
+ args: "-DCMAKE_TOOLCHAIN_FILE=${ANDROID_HOME}/ndk/25.2.9519653/build/cmake/android.toolchain.cmake -DANDROID_ABI=x86 -DBUILD_SHARED_LIBS=ON"
+ }
+ - {
+ name: "Android/So/X64/Release",
+ os: ubuntu-latest,
+ config: Release,
+ args: "-DCMAKE_TOOLCHAIN_FILE=${ANDROID_HOME}/ndk/25.2.9519653/build/cmake/android.toolchain.cmake -DANDROID_ABI=x86_64 -DBUILD_SHARED_LIBS=ON"
+ }
+ - {
+ name: "Windows/Dll/X86/Release",
+ os: windows-latest,
+ config: Release,
+ args: -G "Visual Studio 17 2022" -A Win32 -DBUILD_SHARED_LIBS=ON
+ }
+ - {
+ name: "Windows/Dll/X64/Release",
+ os: windows-latest,
+ config: Release,
+ args: -G "Visual Studio 17 2022" -A Win32 -DBUILD_SHARED_LIBS=ON
+ }
+ - {
+ name: "Windows/Dll/ARMv8/Release",
+ os: windows-latest,
+ config: Release,
+ args: -G "Visual Studio 17 2022" -A ARM64 -DBUILD_SHARED_LIBS=ON
+ }
+ - {
+ name: "Linux/So/X64/Release",
+ os: ubuntu-latest,
+ config: Release,
+ args: -DBUILD_SHARED_LIBS=ON
+ }
+ - {
+ name: "MacOSX/So/X64/Release",
+ os: macos-latest,
+ config: Release,
+ args: -DBUILD_SHARED_LIBS=ON
+ }
+ - {
+ name: "MacOSX/Framework/X64/Release",
+ os: macos-latest,
+ config: Release,
+ args: -DBUILD_FRAMEWORK=ON -DCMAKE_INSTALL_PREFIX=install
+ }
+ # use unix makefiles for iOS to avoid Xcode to complain about signing.
+ - {
+ name: "iOS/Dll/arm64/Release",
+ os: macos-latest,
+ config: Release,
+ args: -G "Unix Makefiles" -DBUILD_SHARED_LIBS=ON -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64
+ }
+ # use unix makefiles for iOS to avoid Xcode to complain about signing.
+ - {
+ name: "iOS/Framework/arm64/Release",
+ os: macos-latest,
+ config: Release,
+ args: -G "Unix Makefiles" -DBUILD_FRAMEWORK=ON -DCMAKE_INSTALL_PREFIX=install -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64
+ }
+ - {
+ name: "Windows/Lib/X86/Release",
+ os: windows-latest,
+ config: Release,
+ args: -G "Visual Studio 17 2022" -A Win32
+ }
+ - {
+ name: "Windows/Lib/X64/Release",
+ os: windows-latest,
+ config: Release,
+ args: -G "Visual Studio 17 2022" -A Win32
+ }
+ - {
+ name: "Windows/Lib/armv8/Release",
+ os: windows-latest,
+ config: Release,
+ args: -G "Visual Studio 17 2022" -A ARM64
+ }
+ - {
+ name: "Linux/Lib/X64/Release",
+ os: ubuntu-latest,
+ config: Release,
+ args: ""
+ }
+ - {
+ name: "MacOSX/Lib/X64/Release",
+ os: macos-latest,
+ config: Release,
+ args: ""
+ }
+ # use unix makefiles for iOS to avoid Xcode to complain about signing.
+ - {
+ name: "iOS/Lib/arm64/Release",
+ os: macos-latest,
+ config: Release,
+ args: -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64
+ }
+ - {
+ name: "Android/Lib/ARMv8/Release",
+ os: ubuntu-latest,
+ config: Release,
+ args: "-DCMAKE_TOOLCHAIN_FILE=${ANDROID_HOME}/ndk/25.2.9519653/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a"
+ }
+ # TODO: Android ARMv7
+ # - {
+ # name: "Android/Lib/ARMv7/Release",
+ # os: ubuntu-latest,
+ # config: Release,
+ # args: "-DCMAKE_TOOLCHAIN_FILE=${ANDROID_HOME}/ndk/25.2.9519653/build/cmake/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a"
+ # }
+ - {
+ name: "Android/Lib/X86/Release",
+ os: ubuntu-latest,
+ config: Release,
+ args: "-DCMAKE_TOOLCHAIN_FILE=${ANDROID_HOME}/ndk/25.2.9519653/build/cmake/android.toolchain.cmake -DANDROID_ABI=x86"
+ }
+ - {
+ name: "Android/Lib/X64/Release",
+ os: ubuntu-latest,
+ config: Release,
+ args: "-DCMAKE_TOOLCHAIN_FILE=${ANDROID_HOME}/ndk/25.2.9519653/build/cmake/android.toolchain.cmake -DANDROID_ABI=x86_64"
+ }
+ - {
+ name: "CustomModes/Linux/Lib/X64/Release",
+ os: ubuntu-latest,
+ config: Release,
+ args: "-DOPUS_CUSTOM_MODES=ON"
+ }
+ - {
+ name: "AssertionsFuzz/Windows/Lib/X64/Release",
+ os: windows-latest,
+ config: Release,
+ args: -G "Visual Studio 17 2022" -A Win32 -DOPUS_ASSERTIONS=ON -DOPUS_FUZZING=ON
+ }
+ - {
+ name: "AssertionsFuzz/Linux/Lib/X64/Release",
+ os: ubuntu-latest,
+ config: Release,
+ args: -DOPUS_ASSERTIONS=ON -DOPUS_FUZZING=ON
+ }
+ - {
+ name: "AssertionsFuzz/MacOSX/Lib/X64/Release",
+ os: macos-latest,
+ config: Release,
+ args: -DOPUS_ASSERTIONS=ON -DOPUS_FUZZING=ON
+ }
+
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ - name: Pull git submodules
+ run: git submodule update --init --recursive
+ - name: Install AutoConf, AutoMake and LibTool # Needed for autogen.sh
+ if: matrix.config.os == 'macos-latest'
+ run: brew install autoconf automake libtool
+ - name: Download models Windows
+ if: contains(matrix.config.name, 'Windows')
+ run: .\autogen.bat
+ - name: Submodule init and Download models
+ if: contains(matrix.config.name, 'MacOSX') ||
+ contains(matrix.config.name, 'Linux') ||
+ contains(matrix.config.name, 'Android') ||
+ contains(matrix.config.name, 'iOS')
+ run: ./autogen.sh
+ - name: Create Work Dir
+ run: mkdir build
+ - name: Configure
+ working-directory: ./build
+ run: cmake .. ${{ matrix.config.args }} -DCMAKE_BUILD_TYPE=${{ matrix.config.config }} -DOPUS_BUILD_PROGRAMS=ON -DBUILD_TESTING=ON
+ - name: Build
+ working-directory: ./build
+ run: cmake --build . -j 2 --config ${{ matrix.config.config }} --target package
+ - name: Test
+ if: contains(matrix.config.name, 'Windows') && !contains(matrix.config.name, 'ARM') && !contains(matrix.config.name, 'Dll') ||
+ contains(matrix.config.name, 'MacOSX') && !contains(matrix.config.name, 'ARM') && !contains(matrix.config.name, 'Dll') ||
+ contains(matrix.config.name, 'Linux') && !contains(matrix.config.name, 'ARM') && !contains(matrix.config.name, 'Dll')
+ working-directory: ./build
+ run: ctest -j 2 -C ${{ matrix.config.config }} --output-on-failure