Skip to content

Commit

Permalink
Merge pull request #2 from ni-nkozlowski/add-ci-workflow
Browse files Browse the repository at this point in the history
Added CI workflow
  • Loading branch information
ni-nkozlowski authored May 22, 2022
2 parents 69378ec + 63825b0 commit 9ab8188
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 113 deletions.
6 changes: 0 additions & 6 deletions .codecov.yml

This file was deleted.

134 changes: 134 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: ni-media CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- name: "Windows 2022"
os: windows-2022
build_type: Release
pcm_tests: ON

- name: "MacOS 12 (xc13)"
os: macos-12
build_type: Release
pcm_tests: ON
set_xcode_version_cmd: xcversion select 13.4

- name: "MacOS 11 (xc12)"
os: macos-11
build_type: Release
pcm_tests: ON
set_xcode_version_cmd: xcversion select 12.4

- name: "MacOS 11 (xc11)"
os: macos-11
build_type: Release
pcm_tests: ON
set_xcode_version_cmd: xcversion select 11.7

- name: "Ubuntu 20.04 (GCC-10)"
os: ubuntu-20.04
build_type: Release
pcm_tests: ON
cc: "gcc-10"
cxx: "g++-10"

- name: "Ubuntu 20.04 (GCC-9)"
os: ubuntu-20.04
build_type: Release
pcm_tests: ON
cc: "gcc-9"
cxx: "g++-9"

- name: "Ubuntu 20.04 (GCC-8)"
os: ubuntu-20.04
build_type: Release
pcm_tests: ON
cc: "gcc-8"
cxx: "g++-8"

- name: "Ubuntu 20.04 (GCC-7)"
os: ubuntu-20.04
build_type: Release
pcm_tests: ON
cc: "gcc-7"
cxx: "g++-7"

- name: "Code-Coverage (Ubuntu 20.04, GCC-9)"
os: ubuntu-20.04
build_type: Coverage
pcm_tests: OFF
code_coverage: true
cc: "gcc-9"
cxx: "g++-9"
gcov: "gcov-9"


steps:
- name: Set xcode version
if: matrix.config.set_xcode_version_cmd != null
run: |
${{ matrix.config.set_xcode_version_cmd }}
- name: Set compiler version
if: matrix.config.cc != null && matrix.config.cxx != null
run: |
sudo apt install ${{ matrix.config.cc }} ${{ matrix.config.cxx }}
echo "CC=${{ matrix.config.cc }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.config.cxx }}" >> $GITHUB_ENV
- name: Set GCOV version
if: matrix.config.gcov != null
run: |
echo "GCOV=${{ matrix.config.gcov }}" >> $GITHUB_ENV
- name: Checkout source
uses: actions/checkout@v2

- name: Install vcpkg
run: |
git clone https://github.com/Microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
- name: Configure CMake + Install Dependencies
run: |
cmake -B ${{ github.workspace }}/build . -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DNIMEDIA_TREAT_WARNINGS_AS_ERRORS=ON -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake -DNIMEDIA_PCM_TESTS=${{ matrix.config.pcm_tests }}
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.config.build_type }}

- name: Test
working-directory: ${{ github.workspace }}/build
run: |
git lfs pull -X \"\"
ctest --verbose -C ${{ matrix.config.build_type }} --timeout 900
- name: Generate Code-Coverage results
if: matrix.config.code_coverage == true
working-directory: ${{ github.workspace }}/build
run: |
sudo apt-get update
sudo apt-get install -y lcov
lcov --version
echo $(which ${GCOV})
lcov --gcov-tool $(which ${GCOV}) -d . -c -o coverage.info
- name: Upload code coverage results
if: matrix.config.code_coverage == true
uses: codecov/[email protected]
with:
files: ${{ github.workspace }}/build/coverage.info
verbose: true
gcov: true
gcov_ignore: test
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# NI MEDIA [![Build Status](https://dev.azure.com/mohinda/ni-media/_apis/build/status/marcrambo.ni-media?branchName=master)](https://dev.azure.com/mohinda/ni-media/_build/latest?definitionId=1&branchName=master) [![codecov](https://codecov.io/gh/NativeInstruments/ni-media/branch/master/graph/badge.svg)](https://codecov.io/gh/NativeInstruments/ni-media)
# NI MEDIA [![ni-media CI](https://github.com/NativeInstruments/ni-media/actions/workflows/ci.yml/badge.svg)](https://github.com/NativeInstruments/ni-media/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/NativeInstruments/ni-media/branch/master/graph/badge.svg)](https://codecov.io/gh/NativeInstruments/ni-media)

NI Media is a library for reading from / writing to audio streams developed at [Native Instruments](https://www.native-instruments.com).

Expand Down
3 changes: 0 additions & 3 deletions audiostream/test/ni/media/audio/ifstream_robustness.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@

#include <vector>


GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST( ifstream_robustness_test );

//----------------------------------------------------------------------------------------------------------------------

class ifstream_robustness_test : public source_test
Expand Down
103 changes: 0 additions & 103 deletions azure-pipelines.yml

This file was deleted.

2 changes: 2 additions & 0 deletions pcm/test/ni/media/pcm/converter.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ TYPED_TEST_P( pcm_clip_test, clip_to_max )
auto expected_max = *--boost::end( pcm::numspace<target_t>( this->bits() ) );
auto actual_max = pcm::detail::convert_to<target_t>( std::numeric_limits<source_t>::max() );

EXPECT_TRUE( ( std::is_same<decltype( actual_max ), decltype( expected_max )>::value ) );
EXPECT_GE( actual_max, expected_max );
}

Expand All @@ -133,6 +134,7 @@ TYPED_TEST_P( pcm_clip_test, clip_to_min )
auto expected_min = *boost::begin( pcm::numspace<target_t>( this->bits() ) );
auto actual_min = pcm::detail::convert_to<target_t>( std::numeric_limits<source_t>::lowest() );

EXPECT_TRUE( ( std::is_same<decltype( actual_min ), decltype( expected_min )>::value ) );
EXPECT_EQ( actual_min, expected_min );
}

Expand Down
1 change: 1 addition & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"boost-icl",
"boost-iostreams",
"boost-locale",
"boost-math",
"boost-program-options",
"boost-system",
"gtest"
Expand Down

0 comments on commit 9ab8188

Please sign in to comment.