Skip to content

Commit d22ffcc

Browse files
committed
ci: add optional abicheck RFC workflow job
1 parent f302d86 commit d22ffcc

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,72 @@ jobs:
160160
run: ctest --output-on-failure
161161
if: ${{ matrix.config.name != 'DEB Package' }}
162162

163+
abicheck-rfc:
164+
name: ABI check (abicheck RFC)
165+
runs-on: ubuntu-22.04
166+
continue-on-error: true
167+
permissions:
168+
contents: read
169+
security-events: write
170+
steps:
171+
- uses: actions/checkout@main
172+
with:
173+
fetch-depth: 0
174+
175+
- name: Deps-packages
176+
shell: bash
177+
run: |
178+
sudo apt-get update
179+
sudo apt-get install -y cmake libpcre2-dev libxxhash-dev
180+
181+
- name: Compute base revision
182+
id: base
183+
shell: bash
184+
run: |
185+
if [ "${{ github.event_name }}" = "pull_request" ]; then
186+
BASE_SHA="${{ github.event.pull_request.base.sha }}"
187+
else
188+
BASE_SHA="$(git rev-parse HEAD~1)"
189+
fi
190+
echo "sha=$BASE_SHA" >> "$GITHUB_OUTPUT"
191+
echo "Using base SHA: $BASE_SHA"
192+
193+
- name: Build base revision
194+
shell: bash
195+
run: |
196+
git worktree add /tmp/libyang-base ${{ steps.base.outputs.sha }}
197+
cmake -S /tmp/libyang-base -B /tmp/build-old -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TESTS=OFF -DENABLE_TOOLS=OFF
198+
cmake --build /tmp/build-old -j2
199+
200+
- name: Build current revision
201+
shell: bash
202+
run: |
203+
cmake -S . -B /tmp/build-new -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TESTS=OFF -DENABLE_TOOLS=OFF
204+
cmake --build /tmp/build-new -j2
205+
206+
- name: Run abicheck
207+
id: abi
208+
uses: napetrov/abicheck@v1
209+
with:
210+
mode: compare
211+
old-library: /tmp/build-old/libyang.so
212+
new-library: /tmp/build-new/libyang.so
213+
old-header: /tmp/libyang-base/src/libyang.h
214+
new-header: src/libyang.h
215+
old-include: /tmp/libyang-base/src /tmp/build-old/libyang
216+
new-include: src /tmp/build-new/libyang
217+
lang: c
218+
format: json
219+
output-file: abicheck-report.json
220+
fail-on-breaking: false
221+
fail-on-api-break: false
222+
223+
- name: Upload report
224+
uses: actions/upload-artifact@v4
225+
with:
226+
name: abicheck-report
227+
path: abicheck-report.json
228+
163229
build-windows:
164230
name: ${{ matrix.name }}
165231
runs-on: ${{ matrix.os }}

0 commit comments

Comments
 (0)