From d22ffcc2dc0d36b34507bffc641dbb5e1b445883 Mon Sep 17 00:00:00 2001 From: Nikolay Petrov Date: Thu, 2 Apr 2026 22:53:39 -0700 Subject: [PATCH 1/3] ci: add optional abicheck RFC workflow job --- .github/workflows/ci.yml | 66 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a34739d3..01cf309cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -160,6 +160,72 @@ jobs: run: ctest --output-on-failure if: ${{ matrix.config.name != 'DEB Package' }} + abicheck-rfc: + name: ABI check (abicheck RFC) + runs-on: ubuntu-22.04 + continue-on-error: true + permissions: + contents: read + security-events: write + steps: + - uses: actions/checkout@main + with: + fetch-depth: 0 + + - name: Deps-packages + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y cmake libpcre2-dev libxxhash-dev + + - name: Compute base revision + id: base + shell: bash + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + BASE_SHA="${{ github.event.pull_request.base.sha }}" + else + BASE_SHA="$(git rev-parse HEAD~1)" + fi + echo "sha=$BASE_SHA" >> "$GITHUB_OUTPUT" + echo "Using base SHA: $BASE_SHA" + + - name: Build base revision + shell: bash + run: | + git worktree add /tmp/libyang-base ${{ steps.base.outputs.sha }} + cmake -S /tmp/libyang-base -B /tmp/build-old -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TESTS=OFF -DENABLE_TOOLS=OFF + cmake --build /tmp/build-old -j2 + + - name: Build current revision + shell: bash + run: | + cmake -S . -B /tmp/build-new -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TESTS=OFF -DENABLE_TOOLS=OFF + cmake --build /tmp/build-new -j2 + + - name: Run abicheck + id: abi + uses: napetrov/abicheck@v1 + with: + mode: compare + old-library: /tmp/build-old/libyang.so + new-library: /tmp/build-new/libyang.so + old-header: /tmp/libyang-base/src/libyang.h + new-header: src/libyang.h + old-include: /tmp/libyang-base/src /tmp/build-old/libyang + new-include: src /tmp/build-new/libyang + lang: c + format: json + output-file: abicheck-report.json + fail-on-breaking: false + fail-on-api-break: false + + - name: Upload report + uses: actions/upload-artifact@v4 + with: + name: abicheck-report + path: abicheck-report.json + build-windows: name: ${{ matrix.name }} runs-on: ${{ matrix.os }} From aae7a79efd7755d7754cd1f22f010ccbc82aa3f1 Mon Sep 17 00:00:00 2001 From: Nikolay Petrov Date: Thu, 2 Apr 2026 23:09:47 -0700 Subject: [PATCH 2/3] ci: pin abicheck action to existing v0.2.0 tag --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01cf309cf..2f1c08e0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -205,7 +205,7 @@ jobs: - name: Run abicheck id: abi - uses: napetrov/abicheck@v1 + uses: napetrov/abicheck@v0.2.0 with: mode: compare old-library: /tmp/build-old/libyang.so From 195f0d0c40c248471f37ba882921f44bba41a5fc Mon Sep 17 00:00:00 2001 From: Nikolay Petrov Date: Thu, 2 Apr 2026 23:11:48 -0700 Subject: [PATCH 3/3] ci: convert abicheck RFC into manual demo workflow --- .github/workflows/abicheck-demo.yml | 76 +++++++++++++++++++++++++++++ .github/workflows/ci.yml | 66 ------------------------- 2 files changed, 76 insertions(+), 66 deletions(-) create mode 100644 .github/workflows/abicheck-demo.yml diff --git a/.github/workflows/abicheck-demo.yml b/.github/workflows/abicheck-demo.yml new file mode 100644 index 000000000..358e0fc8c --- /dev/null +++ b/.github/workflows/abicheck-demo.yml @@ -0,0 +1,76 @@ +name: abicheck demo scan + +on: + workflow_dispatch: + inputs: + base_sha: + description: "Optional base commit SHA (defaults to HEAD~1)" + required: false + type: string + +jobs: + demo-scan: + name: abicheck demo (manual) + runs-on: ubuntu-22.04 + permissions: + contents: read + security-events: write + steps: + - uses: actions/checkout@main + with: + fetch-depth: 0 + + - name: Deps-packages + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y cmake libpcre2-dev libxxhash-dev + + - name: Compute base revision + id: base + shell: bash + run: | + if [ -n "${{ github.event.inputs.base_sha }}" ]; then + BASE_SHA="${{ github.event.inputs.base_sha }}" + else + BASE_SHA="$(git rev-parse HEAD~1)" + fi + git cat-file -e "$BASE_SHA^{commit}" + echo "sha=$BASE_SHA" >> "$GITHUB_OUTPUT" + echo "Using base SHA: $BASE_SHA" + + - name: Build base revision + shell: bash + run: | + git worktree add /tmp/libyang-base ${{ steps.base.outputs.sha }} + cmake -S /tmp/libyang-base -B /tmp/build-old -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TESTS=OFF -DENABLE_TOOLS=OFF + cmake --build /tmp/build-old -j2 + + - name: Build current revision + shell: bash + run: | + cmake -S . -B /tmp/build-new -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TESTS=OFF -DENABLE_TOOLS=OFF + cmake --build /tmp/build-new -j2 + + - name: Run abicheck (demo report) + id: abi + uses: napetrov/abicheck@v0.2.0 + with: + mode: compare + old-library: /tmp/build-old/libyang.so + new-library: /tmp/build-new/libyang.so + old-header: /tmp/libyang-base/src/libyang.h + new-header: src/libyang.h + old-include: /tmp/libyang-base/src /tmp/build-old/libyang + new-include: src /tmp/build-new/libyang + lang: c + format: json + output-file: abicheck-report.json + fail-on-breaking: false + fail-on-api-break: false + + - name: Upload report artifact + uses: actions/upload-artifact@v4 + with: + name: abicheck-demo-report + path: abicheck-report.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f1c08e0a..2a34739d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -160,72 +160,6 @@ jobs: run: ctest --output-on-failure if: ${{ matrix.config.name != 'DEB Package' }} - abicheck-rfc: - name: ABI check (abicheck RFC) - runs-on: ubuntu-22.04 - continue-on-error: true - permissions: - contents: read - security-events: write - steps: - - uses: actions/checkout@main - with: - fetch-depth: 0 - - - name: Deps-packages - shell: bash - run: | - sudo apt-get update - sudo apt-get install -y cmake libpcre2-dev libxxhash-dev - - - name: Compute base revision - id: base - shell: bash - run: | - if [ "${{ github.event_name }}" = "pull_request" ]; then - BASE_SHA="${{ github.event.pull_request.base.sha }}" - else - BASE_SHA="$(git rev-parse HEAD~1)" - fi - echo "sha=$BASE_SHA" >> "$GITHUB_OUTPUT" - echo "Using base SHA: $BASE_SHA" - - - name: Build base revision - shell: bash - run: | - git worktree add /tmp/libyang-base ${{ steps.base.outputs.sha }} - cmake -S /tmp/libyang-base -B /tmp/build-old -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TESTS=OFF -DENABLE_TOOLS=OFF - cmake --build /tmp/build-old -j2 - - - name: Build current revision - shell: bash - run: | - cmake -S . -B /tmp/build-new -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TESTS=OFF -DENABLE_TOOLS=OFF - cmake --build /tmp/build-new -j2 - - - name: Run abicheck - id: abi - uses: napetrov/abicheck@v0.2.0 - with: - mode: compare - old-library: /tmp/build-old/libyang.so - new-library: /tmp/build-new/libyang.so - old-header: /tmp/libyang-base/src/libyang.h - new-header: src/libyang.h - old-include: /tmp/libyang-base/src /tmp/build-old/libyang - new-include: src /tmp/build-new/libyang - lang: c - format: json - output-file: abicheck-report.json - fail-on-breaking: false - fail-on-api-break: false - - - name: Upload report - uses: actions/upload-artifact@v4 - with: - name: abicheck-report - path: abicheck-report.json - build-windows: name: ${{ matrix.name }} runs-on: ${{ matrix.os }}