Debian Codegraph @

.github/workflows/abi.yml

raw
1 name: ABI checks
2
3 on:
4 push:
5 branches: [ "master", "dev" ]
6 pull_request:
7 branches: [ "master", "dev" ]
8
9 env:
10 SRT_BASE: v1.5.0
11
12 jobs:
13 build_pr:
14 name: Build current version
15 runs-on: ubuntu-latest
16
17 outputs:
18 base_version: ${{ steps.build.outputs.SRT_BASE }}
19 tag_version: ${{ steps.build.outputs.SRT_TAG_VERSION }}
20 steps:
21 - uses: actions/checkout@v3
22 with:
23 path: gitview_pr
24 - id: configure
25 name: Configure (cmake)
26 run: |
27 cd gitview_pr
28 mkdir _build && cd _build
29 cmake -DCMAKE_BUILD_TYPE=Debug ../
30 - id: build
31 name: Build and dump
32 run: |
33 sudo apt install -y abi-dumper
34 sudo apt install -y tcl
35 cd gitview_pr/_build && cmake --build ./
36 make install DESTDIR=./installdir
37 SRT_TAG_VERSION=v$(../scripts/get-build-version.tcl full)
38 echo "SRT_TAG_VERSION=$SRT_TAG_VERSION" >> "$GITHUB_OUTPUT"
39 SRT_TAG=${SRT_TAG_VERSION}dev-$(git rev-parse --short HEAD)
40 echo "TAGGING PR BUILD: $SRT_TAG"
41 abi-dumper libsrt.so -o libsrt-pr.dump -public-headers installdir/usr/local/include/srt/ -lver $SRT_TAG
42 ls -ld libsrt-pr.dump
43 sha256sum libsrt-pr.dump
44 SRT_BASE=v$(../scripts/get-build-version.tcl base)
45 if [[ $SRT_TAG_VERSION == $SRT_BASE ]]; then
46 echo "NOT CHECKING ABI: base version is being built: $SRT_TAG (not emitting SRT_BASE)"
47 #echo "SRT_BASE=''" >> "$GITHUB_OUTPUT"
48 else
49 echo "WILL CHECK ABI changes $SRT_BASE - $SRT_TAG_VERSION"
50 echo "SRT_BASE=$SRT_BASE" >> "$GITHUB_OUTPUT"
51 fi
52 - id: upload_pr_dump
53 uses: actions/upload-artifact@v4
54 with:
55 name: abidump_pr
56 path: gitview_pr/_build/libsrt-pr.dump
57
58 build_base:
59 name: Build base version
60 runs-on: ubuntu-latest
61 needs: build_pr
62 if: ${{ needs.build_pr.outputs.base_version != '' }}
63
64 env:
65 SRT_BASE: ${{ needs.build_pr.outputs.base_version }}
66 SRT_TAG_VERSION: ${{ needs.build_pr.outputs.tag_version }}
67 steps:
68 - uses: actions/checkout@v3
69 with:
70 path: gitview_base
71 ref: ${{ env.SRT_BASE }}
72 - id: configure_tag
73 name: Configure (cmake)
74 run: |
75 echo "TAG:$SRT_TAG_VERSION BASE:$SRT_BASE"
76
77 #This is currently a paranoid check - the if should do the job
78 if [[ -z $SRT_BASE ]]; then
79 echo "NO BASE DEFINED. NOT BUILDING"
80 exit 1
81 fi
82 cd gitview_base
83 mkdir _build && cd _build
84 cmake -DCMAKE_BUILD_TYPE=Debug ../
85 - id: build_tag
86 name: Build and dump
87 if: ${{ success() }}
88 run: |
89 sudo apt install -y abi-dumper
90 sudo apt install -y tcl
91 cd gitview_base
92 cd _build && cmake --build ./
93 make install DESTDIR=./installdir
94 echo "TAGGING BASE BUILD: $SRT_BASE"
95 abi-dumper libsrt.so -o libsrt-base.dump -public-headers installdir/usr/local/include/srt/ -lver $SRT_BASE
96 ls -ld libsrt-base.dump
97 sha256sum libsrt-base.dump
98 - id: upload_base_dump
99 uses: actions/upload-artifact@v4
100 with:
101 name: abidump_base
102 path: gitview_base/_build/libsrt-base.dump
103
104 check_abi:
105 name: Compare ABI
106 runs-on: ubuntu-latest
107 needs: [build_pr, build_base]
108 env:
109 SRT_BASE: ${{ needs.build_pr.outputs.base_version }}
110
111 steps:
112 - name: Download base dump
113 uses: actions/download-artifact@v4
114 with:
115 name: abidump_base
116 path: .
117 - name: Download pr dump
118 uses: actions/download-artifact@v4
119 with:
120 name: abidump_pr
121 path: .
122 - name: abi-check
123 run: |
124 git clone https://github.com/lvc/abi-compliance-checker.git
125 #cd gitview_pr/submodules
126 #git submodule update --init abi-compliance-checker
127 cd abi-compliance-checker && sudo make install && cd ../
128 #cd ../..
129 echo "FILESYSTEM state before running abi-check at $PWD"
130 ls -l
131 sha256sum libsrt-base.dump
132 sha256sum libsrt-pr.dump
133 abi-compliance-checker -l libsrt -old libsrt-base.dump -new libsrt-pr.dump
134 RES=$?
135 if (( $RES != 0 )); then
136 echo "ABI/API Compatibility check failed with value $?"
137 exit $RES
138 fi
139 - name: Download report
140 uses: actions/download-artifact@v4
141 with:
142 path: compat_reports