From e6c3991260e884560490c6e63230385e2bd9b271 Mon Sep 17 00:00:00 2001 From: yomnes0 <127947185+yomnes0@users.noreply.github.com> Date: Wed, 6 Mar 2024 16:36:09 +0100 Subject: [PATCH 1/3] [build] Add an action to check API/ABI compatibility --- .github/workflows/abi.yml | 58 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/abi.yml diff --git a/.github/workflows/abi.yml b/.github/workflows/abi.yml new file mode 100644 index 000000000..c2ebe4fd9 --- /dev/null +++ b/.github/workflows/abi.yml @@ -0,0 +1,58 @@ +name: ABI checks + +on: + push: + workflow_dispatch: + +env: + SRT_BASE: v1.5.0 + +jobs: + build: + name: ABI checks + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v3 + with: + path: pull_request + - name: configure + run: | + cd pull_request + mkdir _build && cd _build + cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_UNITTESTS=ON ../ + - name: build + run: | + sudo apt install -y abi-dumper + cd pull_request/_build && cmake --build ./ + make install DESTDIR=./installdir + SRT_TAG_VERSION=$(cat version.h |grep SRT_VERSION_MINOR |head -n1 |awk {'print $3'}) + abi-dumper libsrt.so -o libsrt-pr.dump -public-headers installdir/usr/local/include/srt/ -lver 0 + SRT_BASE="v1.$SRT_TAG_VERSION.0" + echo "SRT_BASE=$SRT_BASE" >> "$GITHUB_ENV" + - uses: actions/checkout@v3 + with: + path: tag + ref: ${{ env.SRT_BASE }} + - name: configure_tag + run: | + echo $SRT_TAG_VERSION + cd tag + mkdir _build && cd _build + cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_UNITTESTS=ON ../ + - name: build_tag + run: | + cd tag + cd _build && cmake --build ./ + make install DESTDIR=./installdir + abi-dumper libsrt.so -o libsrt-tag.dump -public-headers installdir/usr/local/include/srt/ -lver 1 + - name: abi-check + run: | + git clone https://github.com/lvc/abi-compliance-checker.git + cd abi-compliance-checker && sudo make install && cd ../ + abi-compliance-checker -l libsrt -old tag/_build/libsrt-tag.dump -new pull_request/_build/libsrt-pr.dump + if (( $? != 0 )) + then + echo "ABI/API Compatibility check failed with value $?" + exit $? + fi From 45106c60f51e750cdd8fa62b7f49906c8386cbb7 Mon Sep 17 00:00:00 2001 From: yomnes0 <127947185+yomnes0@users.noreply.github.com> Date: Thu, 7 Mar 2024 08:55:32 +0100 Subject: [PATCH 2/3] [build] Fix action triggers --- .github/workflows/abi.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/abi.yml b/.github/workflows/abi.yml index c2ebe4fd9..85312f22c 100644 --- a/.github/workflows/abi.yml +++ b/.github/workflows/abi.yml @@ -2,7 +2,9 @@ name: ABI checks on: push: - workflow_dispatch: + branches: [ master ] + pull_request: + branches: [ master ] env: SRT_BASE: v1.5.0 From 42e7f36552a6d0255f44235914c4af8fbcc0f3b3 Mon Sep 17 00:00:00 2001 From: yomnes0 <127947185+yomnes0@users.noreply.github.com> Date: Mon, 11 Mar 2024 08:48:56 +0100 Subject: [PATCH 3/3] [build] Fix return value in case of abi compliance failure --- .github/workflows/abi.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/abi.yml b/.github/workflows/abi.yml index 85312f22c..2c05cc06b 100644 --- a/.github/workflows/abi.yml +++ b/.github/workflows/abi.yml @@ -53,8 +53,9 @@ jobs: git clone https://github.com/lvc/abi-compliance-checker.git cd abi-compliance-checker && sudo make install && cd ../ abi-compliance-checker -l libsrt -old tag/_build/libsrt-tag.dump -new pull_request/_build/libsrt-pr.dump - if (( $? != 0 )) + RES=$? + if (( $RES != 0 )) then echo "ABI/API Compatibility check failed with value $?" - exit $? + exit $RES fi