C/C++ CI #519
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: C/C++ CI | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Preparation on Linux | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install libpulse-dev | |
- name: Preparation on Windows | |
if: runner.os == 'Windows' | |
uses: microsoft/setup-msbuild@v2 | |
- name: Build libraries | |
run: | | |
cmake -B build_debug -DCMAKE_BUILD_TYPE=Debug | |
cmake --build build_debug --config Debug | |
cmake -B build_release -DCMAKE_BUILD_TYPE=Release | |
cmake --build build_release --config Release | |
- name: Test | |
run: | | |
pushd build_debug | |
ctest -C Debug | |
popd | |
pushd build_release | |
ctest -C Release | |
popd | |
- name: Build tools | |
run: | | |
pushd tools/srla_codec | |
cmake -B build -DCMAKE_BUILD_TYPE=Release | |
cmake --build build --config Release | |
popd | |
pushd tools/srla_player | |
cmake -B build -DCMAKE_BUILD_TYPE=Release | |
cmake --build build --config Release | |
popd | |
- name: Build SSE/AVX libraries and tools | |
if: runner.os == 'Windows' || runner.os == 'Linux' | |
run: | | |
cmake -B build_release_sse41 -DCMAKE_BUILD_TYPE=Release -DUSE_SIMD_INTRINSICS=SSE41 | |
cmake --build build_release_sse41 --config Release | |
cmake -B build_release_avx2 -DCMAKE_BUILD_TYPE=Release -DUSE_SIMD_INTRINSICS=AVX2 | |
cmake --build build_release_avx2 --config Release | |
pushd build_release_sse41 | |
ctest -C Release | |
popd | |
pushd build_release_avx2 | |
ctest -C Release | |
popd | |
pushd tools/srla_codec | |
cmake -B build_sse41 -DCMAKE_BUILD_TYPE=Release -DUSE_SIMD_INTRINSICS=SSE41 | |
cmake --build build_sse41 --config Release | |
popd | |
pushd tools/srla_player | |
cmake -B build_sse41 -DCMAKE_BUILD_TYPE=Release -DUSE_SIMD_INTRINSICS=SSE41 | |
cmake --build build_sse41 --config Release | |
popd | |
pushd tools/srla_codec | |
cmake -B build_avx2 -DCMAKE_BUILD_TYPE=Release -DUSE_SIMD_INTRINSICS=AVX2 | |
cmake --build build_avx2 --config Release | |
popd | |
pushd tools/srla_player | |
cmake -B build_avx2 -DCMAKE_BUILD_TYPE=Release -DUSE_SIMD_INTRINSICS=AVX2 | |
cmake --build build_avx2 --config Release | |
popd | |
- name: Create artifacts on Linux platform | |
if: runner.os == 'Linux' | |
run: | | |
ARTIFACT_ROOT=srla_${{ matrix.os }} | |
mkdir ${ARTIFACT_ROOT} | |
pushd ${ARTIFACT_ROOT} | |
mkdir include && mkdir libs && mkdir tools | |
popd | |
cp include/*.h ${ARTIFACT_ROOT}/include/ | |
cp build_release/libsrlacodec.a ${ARTIFACT_ROOT}/libs/ | |
cp build_release/libsrladec.a ${ARTIFACT_ROOT}/libs/ | |
cp tools/srla_codec/build/srla ${ARTIFACT_ROOT}/tools/ | |
cp tools/srla_player/build/srlaplayer ${ARTIFACT_ROOT}/tools/ | |
tar -czf ${ARTIFACT_ROOT}.tar.gz ${ARTIFACT_ROOT} | |
ARTIFACT_ROOT_SSE41=srla_${{ matrix.os }}_sse41 | |
mkdir ${ARTIFACT_ROOT_SSE41} | |
pushd ${ARTIFACT_ROOT_SSE41} | |
mkdir include && mkdir libs && mkdir tools | |
popd | |
cp include/*.h ${ARTIFACT_ROOT_SSE41}/include/ | |
cp build_release_sse41/libsrlacodec.a ${ARTIFACT_ROOT_SSE41}/libs/ | |
cp build_release_sse41/libsrladec.a ${ARTIFACT_ROOT_SSE41}/libs/ | |
cp tools/srla_codec/build_sse41/srla ${ARTIFACT_ROOT_SSE41}/tools/ | |
cp tools/srla_player/build_sse41/srlaplayer ${ARTIFACT_ROOT_SSE41}/tools/ | |
tar -czf ${ARTIFACT_ROOT_SSE41}.tar.gz ${ARTIFACT_ROOT_SSE41} | |
ARTIFACT_ROOT_AVX2=srla_${{ matrix.os }}_avx2 | |
mkdir ${ARTIFACT_ROOT_AVX2} | |
pushd ${ARTIFACT_ROOT_AVX2} | |
mkdir include && mkdir libs && mkdir tools | |
popd | |
cp include/*.h ${ARTIFACT_ROOT_AVX2}/include/ | |
cp build_release_avx2/libsrlacodec.a ${ARTIFACT_ROOT_AVX2}/libs/ | |
cp build_release_avx2/libsrladec.a ${ARTIFACT_ROOT_AVX2}/libs/ | |
cp tools/srla_codec/build_avx2/srla ${ARTIFACT_ROOT_AVX2}/tools/ | |
cp tools/srla_player/build_avx2/srlaplayer ${ARTIFACT_ROOT_AVX2}/tools/ | |
tar -czf ${ARTIFACT_ROOT_AVX2}.tar.gz ${ARTIFACT_ROOT_AVX2} | |
- name: Create artifacts on macOS platform | |
if: runner.os == 'macOS' | |
run: | | |
ARTIFACT_ROOT=srla_${{ matrix.os }} | |
mkdir ${ARTIFACT_ROOT} | |
pushd ${ARTIFACT_ROOT} | |
mkdir include && mkdir libs && mkdir tools | |
popd | |
cp include/*.h ${ARTIFACT_ROOT}/include/ | |
cp build_release/libsrlacodec.a ${ARTIFACT_ROOT}/libs/ | |
cp build_release/libsrladec.a ${ARTIFACT_ROOT}/libs/ | |
cp tools/srla_codec/build/srla ${ARTIFACT_ROOT}/tools/ | |
cp tools/srla_player/build/srlaplayer ${ARTIFACT_ROOT}/tools/ | |
tar -czf ${ARTIFACT_ROOT}.tar.gz ${ARTIFACT_ROOT} | |
- name: Create artifacts on Windows platform | |
if: runner.os == 'Windows' | |
shell: powershell | |
run: | | |
$ARTIFACT_ROOT = "srla_${{ matrix.os }}" | |
mkdir ${ARTIFACT_ROOT} | |
pushd ${ARTIFACT_ROOT} | |
mkdir include | |
mkdir libs | |
mkdir tools | |
popd | |
cp include/*.h ${ARTIFACT_ROOT}/include/ | |
cp build_release/Release/srlacodec.lib ${ARTIFACT_ROOT}/libs/ | |
cp build_release/Release/srladec.lib ${ARTIFACT_ROOT}/libs/ | |
cp tools/srla_codec/build/Release/srla.exe ${ARTIFACT_ROOT}/tools/ | |
cp tools/srla_player/build/Release/srlaplayer.exe ${ARTIFACT_ROOT}/tools/ | |
tar -czf "${ARTIFACT_ROOT}.tar.gz" ${ARTIFACT_ROOT} | |
$ARTIFACT_ROOT_SSE41 = "srla_${{ matrix.os }}_sse41" | |
mkdir ${ARTIFACT_ROOT_SSE41} | |
pushd ${ARTIFACT_ROOT_SSE41} | |
mkdir include | |
mkdir libs | |
mkdir tools | |
popd | |
cp include/*.h ${ARTIFACT_ROOT_SSE41}/include/ | |
cp build_release_sse41/Release/srlacodec.lib ${ARTIFACT_ROOT_SSE41}/libs/ | |
cp build_release_sse41/Release/srladec.lib ${ARTIFACT_ROOT_SSE41}/libs/ | |
cp tools/srla_codec/build_sse41/Release/srla.exe ${ARTIFACT_ROOT_SSE41}/tools/ | |
cp tools/srla_player/build_sse41/Release/srlaplayer.exe ${ARTIFACT_ROOT_SSE41}/tools/ | |
tar -czf "${ARTIFACT_ROOT_SSE41}.tar.gz" ${ARTIFACT_ROOT_SSE41} | |
$ARTIFACT_ROOT_AVX2 = "srla_${{ matrix.os }}_avx2" | |
mkdir ${ARTIFACT_ROOT_AVX2} | |
pushd ${ARTIFACT_ROOT_AVX2} | |
mkdir include | |
mkdir libs | |
mkdir tools | |
popd | |
cp include/*.h ${ARTIFACT_ROOT_AVX2}/include/ | |
cp build_release_avx2/Release/srlacodec.lib ${ARTIFACT_ROOT_AVX2}/libs/ | |
cp build_release_avx2/Release/srladec.lib ${ARTIFACT_ROOT_AVX2}/libs/ | |
cp tools/srla_codec/build_avx2/Release/srla.exe ${ARTIFACT_ROOT_AVX2}/tools/ | |
cp tools/srla_player/build_avx2/Release/srlaplayer.exe ${ARTIFACT_ROOT_AVX2}/tools/ | |
tar -czf "${ARTIFACT_ROOT_AVX2}.tar.gz" ${ARTIFACT_ROOT_AVX2} | |
- name: Upload artifacts on macOS platform | |
if: runner.os == 'macOS' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts_${{ matrix.os }} | |
path: | | |
srla_${{ matrix.os }}.tar.gz | |
- name: Upload artifacts on Linux / Windows platforms | |
if: runner.os == 'Linux' || runner.os == 'Windows' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts_${{ matrix.os }} | |
path: | | |
srla_${{ matrix.os }}.tar.gz | |
srla_${{ matrix.os }}_sse41.tar.gz | |
srla_${{ matrix.os }}_avx2.tar.gz |