Skip to content

Commit

Permalink
Merge commit 'd0da7dbc8279179f0f2dd99278b0bf6bb0ceb4ec'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sibras committed Jan 10, 2021
2 parents 1689589 + d0da7db commit c568c2f
Show file tree
Hide file tree
Showing 8 changed files with 306 additions and 34 deletions.
96 changes: 65 additions & 31 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,32 @@ name: CMake
on: [push]

jobs:
check-ci:
runs-on: ubuntu-latest
outputs:
full-ci: ${{steps.check.outputs.all}}
steps:
- name: Check [full ci] annotation
id: check
run: |
before=${{github.event.before}}
if [ -z "$before" -o "$before" == 0000000000000000000000000000000000000000]; then
before=main
fi
if [ ${{github.event.ref}} == refs/heads/main ] ||
curl -H "Accept: application/vnd.github.v3+json" \
-H 'Authorization: Bearer ${{secrets.GITHUB_TOKEN}}' \
https://api.github.com/repos/TimothyGu/libilbc/compare/$before...${{github.event.after}} |
jq -r '[.commits[].commit.message] | join(" ")' |
grep -Fq '[full ci]'
then
echo "::set-output name=all::true"
echo "Running full CI"
else
echo "::set-output name=all::false"
echo "Only running fast CI"
fi
build-fast:
strategy:
matrix:
Expand Down Expand Up @@ -50,18 +76,28 @@ jobs:
- name: Run ilbc_test
shell: bash
run: |
cmake --build '${{runner.workspace}}/build' --config $CONFIG -v -t ilbc_test-sample
cmake --build '${{runner.workspace}}/build' --config $CONFIG -v -t ilbc_test-sample ilbc_test2-sample
wc -c "$GITHUB_WORKSPACE/sample.pcm"
wc -c '${{runner.workspace}}/build/decoded.pcm'
wc -c '${{runner.workspace}}/build/decoded2.pcm'
cmake -E sha256sum '${{runner.workspace}}/build/decoded.pcm'
cmake -E sha256sum '${{runner.workspace}}/build/decoded2.pcm'
expect=722ad5f71f80736195669604c20e448618cb03896e4e9869c6291abe5cc5ab8c
actual=$(cmake -E sha256sum '${{runner.workspace}}/build/decoded.pcm' | cut -f1 -d' ')
actual2=$(cmake -E sha256sum '${{runner.workspace}}/build/decoded2.pcm' | cut -f1 -d' ')
exitcode=0
if [ "$expect" != "$actual" ]; then
echo 'Expected decoded.pcm to have hash'
echo " $expect"
echo 'found'
echo " $actual"
exitcode=1
fi
if [ "$expect" != "$actual2" ]; then
echo 'Expected decoded2.pcm to have hash'
echo " $expect"
exitcode=1
fi
exit $exitcode
- name: Install
shell: bash
Expand All @@ -70,28 +106,6 @@ jobs:
DESTDIR='${{runner.workspace}}/install' cmake --install '${{runner.workspace}}/build' --config $CONFIG
find '${{runner.workspace}}/install'
check-ci:
runs-on: ubuntu-latest
outputs:
full-ci: ${{steps.check.outputs.all}}
steps:
- name: Check [full ci] annotation
id: check
run: |
if [ ${{github.event.ref}} == refs/heads/main ] ||
curl -H "Accept: application/vnd.github.v3+json" \
-H 'Authorization: Bearer ${{secrets.GITHUB_TOKEN}}' \
https://api.github.com/repos/TimothyGu/libilbc/compare/${{github.event.before}}...${{github.event.after}} |
jq -r '[.commits[].commit.message] | join(" ")' |
grep -Fq '[full ci]'
then
echo "::set-output name=all::true"
echo "Running full CI"
else
echo "::set-output name=all::false"
echo "Only running fast CI"
fi
build:
strategy:
matrix:
Expand Down Expand Up @@ -173,18 +187,28 @@ jobs:
- name: Run ilbc_test
shell: bash
run: |
cmake --build '${{runner.workspace}}/build' --config $CONFIG -v -t ilbc_test-sample
cmake --build '${{runner.workspace}}/build' --config $CONFIG -v -t ilbc_test-sample ilbc_test2-sample
wc -c "$GITHUB_WORKSPACE/sample.pcm"
wc -c '${{runner.workspace}}/build/decoded.pcm'
wc -c '${{runner.workspace}}/build/decoded2.pcm'
cmake -E sha256sum '${{runner.workspace}}/build/decoded.pcm'
cmake -E sha256sum '${{runner.workspace}}/build/decoded2.pcm'
expect=722ad5f71f80736195669604c20e448618cb03896e4e9869c6291abe5cc5ab8c
actual=$(cmake -E sha256sum '${{runner.workspace}}/build/decoded.pcm' | cut -f1 -d' ')
actual2=$(cmake -E sha256sum '${{runner.workspace}}/build/decoded2.pcm' | cut -f1 -d' ')
exitcode=0
if [ "$expect" != "$actual" ]; then
echo 'Expected decoded.pcm to have hash'
echo " $expect"
echo 'found'
echo " $actual"
exitcode=1
fi
if [ "$expect" != "$actual2" ]; then
echo 'Expected decoded2.pcm to have hash'
echo " $expect"
exitcode=1
fi
exit $exitcode
- name: Install
shell: bash
Expand Down Expand Up @@ -337,15 +361,25 @@ jobs:
-v '${{runner.workspace}}/build:/build:rw' \
--entrypoint /bin/bash \
${{matrix.docker}} \
-c 'uname -m && LD_LIBRARY_PATH=/build /build/ilbc_test 20 /src/sample.pcm /build/encoded.ilbc /build/decoded.pcm'
-c 'uname -m && LD_LIBRARY_PATH=/build /build/ilbc_test 20 /src/sample.pcm /build/encoded.ilbc /build/decoded.pcm && LD_LIBRARY_PATH=/build /build/ilbc_test2 20 /src/sample.pcm /build/encoded2.ilbc /build/decoded2.pcm'
wc -c "$GITHUB_WORKSPACE/sample.pcm"
wc -c '${{runner.workspace}}/build/decoded.pcm'
wc -c '${{runner.workspace}}/build/decoded2.pcm'
cmake -E sha256sum '${{runner.workspace}}/build/decoded.pcm'
cmake -E sha256sum '${{runner.workspace}}/build/decoded2.pcm'
expect=722ad5f71f80736195669604c20e448618cb03896e4e9869c6291abe5cc5ab8c
actual=$(cmake -E sha256sum '${{runner.workspace}}/build/decoded.pcm' | cut -f1 -d' ')
actual2=$(cmake -E sha256sum '${{runner.workspace}}/build/decoded2.pcm' | cut -f1 -d' ')
exitcode=0
if [ "$expect" != "$actual" ]; then
echo 'Expected decoded.pcm to have hash'
echo " $expect"
echo 'found'
echo " $actual"
exitcode=1
fi
if [ "$expect" != "$actual2" ]; then
echo 'Expected decoded2.pcm to have hash'
echo " $expect"
exitcode=1
fi
exit $exitcode
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ install_manifest.txt

ilbc_export.h
ilbc_test
ilbc_test2

# From upstream
*.DS_Store
Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
cmake_minimum_required(VERSION 3.5)

project(libilbc
VERSION 3.0.2
VERSION 3.0.3
DESCRIPTION "WebRTC's implementation of the Internet Low Bitrate Codec (iLBC)"
HOMEPAGE_URL "https://github.com/TimothyGu/libilbc"
LANGUAGES C CXX)
Expand Down Expand Up @@ -314,8 +314,13 @@ set_target_properties(ilbc PROPERTIES CLEAN_DIRECT_OUTPUT 1)
add_executable(ilbc_test modules/audio_coding/codecs/ilbc/test/iLBC_test.c)
target_link_libraries(ilbc_test ilbc)

add_executable(ilbc_test2 iLBC_test2.c)
target_link_libraries(ilbc_test2 ilbc)

add_custom_target(ilbc_test-sample
ilbc_test 20 ${CMAKE_CURRENT_SOURCE_DIR}/sample.pcm encoded.ilbc decoded.pcm)
add_custom_target(ilbc_test2-sample
ilbc_test2 20 ${CMAKE_CURRENT_SOURCE_DIR}/sample.pcm encoded2.ilbc decoded2.pcm)

###################################################################################################
## Installation
Expand Down
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Changes in 3.0.3 (2020-12-18)
-----------------------------

Made `WebRtcIlbcfix_InitDecode` an exported symbol on shared library builds.
([#32]) Thanks again to Daniel Bermond <[email protected]> for noticing
this.

Changes in 3.0.2 (2020-12-18)
-----------------------------

Expand Down Expand Up @@ -123,3 +130,4 @@ Changes in 2.0.0 (2014-11-17)
- Travis CI support is added.

[#28]: https://github.com/TimothyGu/libilbc/issues/28
[#32]: https://github.com/TimothyGu/libilbc/issues/32
Loading

0 comments on commit c568c2f

Please sign in to comment.