2020-04-21 12:58:30 -04:00
|
|
|
on: [pull_request]
|
|
|
|
name: abicheck
|
2021-01-06 11:10:59 -05:00
|
|
|
env:
|
|
|
|
build_options: -Dbuildtype=debug -Denable-true-color=yes -Dwith-proxy=yes -Dc_args=-DPERL_EUPXS_ALWAYS_EXPORT
|
|
|
|
prefix: /usr/local
|
|
|
|
apt_build_deps: ninja-build libutf8proc-dev libperl-dev libotr5-dev
|
|
|
|
get_pip_build_deps: pip3 install setuptools; pip3 install wheel; pip3 install meson
|
|
|
|
getabidef_def: getabidef() { awk '$1=="#define" && $2=="IRSSI_ABI_VERSION" { print $3 }' "$1"/include/irssi/src/common.h; }
|
2020-04-21 12:58:30 -04:00
|
|
|
jobs:
|
2021-01-06 11:10:59 -05:00
|
|
|
build-base-ref:
|
2020-04-21 12:58:30 -04:00
|
|
|
runs-on: ubuntu-latest
|
2021-01-06 11:10:59 -05:00
|
|
|
outputs:
|
|
|
|
base_abi: ${{ steps.out.outputs.base_abi }}
|
2020-04-21 12:58:30 -04:00
|
|
|
steps:
|
|
|
|
- name: set PATH
|
|
|
|
run: |
|
2020-10-26 18:24:30 -04:00
|
|
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
2020-04-21 12:58:30 -04:00
|
|
|
- name: prepare required software
|
|
|
|
run: |
|
2021-01-06 11:10:59 -05:00
|
|
|
sudo apt install $apt_build_deps
|
|
|
|
eval "$get_pip_build_deps"
|
2020-04-21 12:58:30 -04:00
|
|
|
- name: checkout base ref
|
2020-07-23 06:05:19 -04:00
|
|
|
uses: actions/checkout@main
|
2020-04-21 12:58:30 -04:00
|
|
|
with:
|
|
|
|
path: base.src
|
|
|
|
ref: ${{ github.base_ref }}
|
|
|
|
- name: build base ref
|
|
|
|
run: |
|
|
|
|
meson Build.base base.src $build_options
|
|
|
|
ninja -C Build.base
|
|
|
|
DESTDIR=$PWD/base ninja -C Build.base install
|
2021-01-06 11:10:59 -05:00
|
|
|
- id: out
|
|
|
|
run: |
|
|
|
|
# print versions and abi versions
|
|
|
|
eval "$getabidef_def"
|
|
|
|
base_abi=$(getabidef base$prefix)
|
|
|
|
echo base abi : $base_abi
|
|
|
|
./base$prefix/bin/irssi --version
|
|
|
|
echo "::set-output name=base_abi::$base_abi"
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: base.inst
|
|
|
|
path: base
|
|
|
|
retention-days: 1
|
|
|
|
build-merge-ref:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
merge_abi: ${{ steps.out.outputs.merge_abi }}
|
|
|
|
steps:
|
|
|
|
- name: set PATH
|
|
|
|
run: |
|
|
|
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
|
|
- name: prepare required software
|
|
|
|
run: |
|
|
|
|
sudo apt install $apt_build_deps
|
|
|
|
eval "$get_pip_build_deps"
|
|
|
|
- name: checkout merge ref
|
|
|
|
uses: actions/checkout@main
|
|
|
|
with:
|
|
|
|
path: merge.src
|
2020-04-21 12:58:30 -04:00
|
|
|
- name: build merge ref
|
|
|
|
run: |
|
|
|
|
meson Build.merge merge.src $build_options
|
|
|
|
ninja -C Build.merge
|
|
|
|
DESTDIR=$PWD/merge ninja -C Build.merge install
|
2021-01-06 11:10:59 -05:00
|
|
|
- id: out
|
|
|
|
run: |
|
2020-04-21 12:58:30 -04:00
|
|
|
# print versions and abi versions
|
2021-01-06 11:10:59 -05:00
|
|
|
eval "$getabidef_def"
|
2020-04-21 12:58:30 -04:00
|
|
|
merge_abi=$(getabidef merge$prefix)
|
|
|
|
echo merge abi : $merge_abi
|
|
|
|
./merge$prefix/bin/irssi --version
|
2021-01-06 11:10:59 -05:00
|
|
|
echo "::set-output name=merge_abi::$merge_abi"
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: merge.inst
|
|
|
|
path: merge
|
|
|
|
retention-days: 1
|
|
|
|
check-abi-diff:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs:
|
|
|
|
- build-merge-ref
|
|
|
|
- build-base-ref
|
|
|
|
env:
|
|
|
|
base_abi: ${{ needs.build-base-ref.outputs.base_abi }}
|
|
|
|
merge_abi: ${{ needs.build-merge-ref.outputs.merge_abi }}
|
|
|
|
steps:
|
|
|
|
- name: prepare required software
|
|
|
|
run: |
|
|
|
|
sudo apt install abigail-tools
|
|
|
|
- name: fetch base build
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: base.inst
|
|
|
|
path: base
|
|
|
|
- name: fetch merge build
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: merge.inst
|
|
|
|
path: merge
|
2020-04-21 12:58:30 -04:00
|
|
|
- run: |
|
|
|
|
# abipkgdiff
|
2021-01-06 11:10:59 -05:00
|
|
|
abipkgdiff -l base merge >abipkgdiff.out && diff_ret=0 || diff_ret=$?
|
2020-10-26 18:24:30 -04:00
|
|
|
echo "diff_ret=$diff_ret" >> $GITHUB_ENV
|
2021-01-06 11:10:59 -05:00
|
|
|
cat abipkgdiff.out
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
path: abipkgdiff.out
|
2020-04-21 12:58:30 -04:00
|
|
|
- run: |
|
|
|
|
# Check if no changes are needed
|
|
|
|
if [ "$diff_ret" -ne 0 ]; then
|
|
|
|
if [ "$base_abi" -lt "$merge_abi" ]; then
|
|
|
|
echo "::warning ::abigail found changes and ABI changed from $base_abi to $merge_abi"
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
echo "::error ::Looks like the ABI changed but the IRSSI_ABI_VERSION did not"
|
|
|
|
exit $diff_ret
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
if [ "$base_abi" -ne "$merge_abi" ]; then
|
|
|
|
echo "::error ::abigail found no changes yet the IRSSI_ABI_VERSION changed. Is this correct?"
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
: "No changes detected and IRSSI_ABI_VERSION untouched"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|