From 7301acfe83be68ae7c2f1c9dc3e7fdde19409980 Mon Sep 17 00:00:00 2001 From: Martin Wilck Date: Thu, 14 Nov 2024 16:51:05 +0100 Subject: [PATCH] GitHub Workflows: add abi check for stable branches The ABI should never change on a stable branch. This workflow asserts that. Signed-off-by: Martin Wilck --- .github/workflows/abi-stable.yaml | 101 ++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 .github/workflows/abi-stable.yaml diff --git a/.github/workflows/abi-stable.yaml b/.github/workflows/abi-stable.yaml new file mode 100644 index 00000000..942ddced --- /dev/null +++ b/.github/workflows/abi-stable.yaml @@ -0,0 +1,101 @@ +name: check-abi +on: + push: + branches: + - 'stable-*' + paths: + - '.github/workflows/abi-stable.yaml' + - '**.h' + - '**.c' + - '**.version' + pull_request: + branches: + - 'stable-*' + workflow_dispatch: + +jobs: + reference-abi: + runs-on: ubuntu-20.04 + steps: + - name: get parent tag + run: > + echo ${{ github.ref }} | + sed -E 's,refs/heads/stable-([0-9]\.[0-9]*)\.y,PARENT_TAG=\1.0,' + >> $GITHUB_ENV + - name: assert parent tag + run: /bin/false + if: ${{ env.PARENT_TAG == '' }} + - name: download ABI for ${{ env.PARENT_TAG }} + id: download_abi + uses: actions/download-artifact@v4 + with: + name: multipath-abi-${{ env.PARENT_TAG }} + continue-on-error: true + - name: update + run: sudo apt-get update + if: steps.download_abi.outcome != 'success' + - name: dependencies + run: > + sudo apt-get install --yes gcc + gcc make pkg-config abigail-tools + libdevmapper-dev libreadline-dev libaio-dev libsystemd-dev + libudev-dev libjson-c-dev liburcu-dev libcmocka-dev libedit-dev + if: steps.download_abi.outcome != 'success' + - name: checkout ${{ env.PARENT_TAG }} + uses: actions/checkout@v4 + with: + ref: ${{ env.PARENT_TAG }} + if: steps.download_abi.outcome != 'success' + - name: build ABI for ${{ env.PARENT_TAG }} + run: make -Orecurse -j$(grep -c ^processor /proc/cpuinfo) abi + if: steps.download_abi.outcome != 'success' + - name: save ABI + uses: actions/upload-artifact@v4 + with: + name: abi + path: abi + if: steps.download_abi.outcome != 'success' + + check-abi: + runs-on: ubuntu-20.04 + needs: reference-abi + steps: + - name: get parent tag + run: > + echo ${{ github.ref }} | + sed -E 's,refs/heads/stable-([0-9]\.[0-9]*)\.y,PARENT_TAG=\1.0,' + >> $GITHUB_ENV + - name: assert parent tag + run: /bin/false + if: ${{ env.PARENT_TAG == '' }} + - name: checkout ${{ env.PARENT_TAG }} + uses: actions/checkout@v4 + with: + ref: ${{ env.PARENT_TAG }} + - name: download ABI for ${{ env.PARENT_TAG }} + id: download_abi + uses: actions/download-artifact@v4 + with: + name: multipath-abi-${{ env.PARENT_TAG }} + path: reference_abi + - name: look + run: ls -l + - name: update + run: sudo apt-get update + if: steps.download_abi.outcome != 'success' + - name: dependencies + run: > + sudo apt-get install --yes gcc + gcc make pkg-config abigail-tools + libdevmapper-dev libreadline-dev libaio-dev libsystemd-dev + libudev-dev libjson-c-dev liburcu-dev libcmocka-dev libedit-dev + - name: check ABI of ${{ github.ref }} against ${{ env.PARENT_TAG }} + id: check_abi + run: make -Orecurse -j$(grep -c ^processor /proc/cpuinfo) abi-test + continue-on-error: true + - name: print errors + run: cat abi-test + if: steps.check_abi.outcome != 'success' + - name: fail + run: /bin/false + if: steps.check_abi.outcome != 'success'