libexpat/.github/workflows/autotools-cmake.yml
2021-05-02 19:53:29 +02:00

102 lines
3.6 KiB
YAML

# __ __ _
# ___\ \/ /_ __ __ _| |_
# / _ \\ /| '_ \ / _` | __|
# | __// \| |_) | (_| | |_
# \___/_/\_\ .__/ \__,_|\__|
# |_| XML parser
#
# Copyright (c) 2021 Sebastian Pipping <sebastian@pipping.org>
# Licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the
# following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
# USE OR OTHER DEALINGS IN THE SOFTWARE.
name: Ensure that GNU Autotools and CMake build systems agree
on:
pull_request:
push:
schedule:
- cron: '0 2 * * 5' # Every Friday at 2am
jobs:
checks:
name: Ensure that GNU Autotools and CMake build systems agree
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2.3.4
- name: Install build dependencies
run: |-
sudo apt-get install --yes --no-install-recommends -V \
cmake \
docbook2x \
lzip
- name: Produce and extract a release archive
run: |
set -x
cd expat
./buildconf.sh
./configure
make dist
tar xf expat-*.*.*.tar.gz
- name: Build and install using GNU Autotools
run: |
set -x
cd expat/expat-*.*.*/
mkdir build_autotools
cd build_autotools
../configure --libdir='${exec_prefix}/lib123'
make install DESTDIR="${PWD}"/ROOT
- name: Build and install using CMake
run: |
set -x
cd expat/expat-*.*.*/
mkdir build_cmake
cd build_cmake
cmake -DCMAKE_INSTALL_LIBDIR=lib123 ..
make install DESTDIR="${PWD}"/ROOT
- name: Check for identical CMake files from both build systems
run: |
set -x
cd expat/expat-*.*.*/
diff \
--recursive \
--unified \
--exclude=xmlwf \
--exclude=libexpat.a \
--exclude=libexpat.la \
--exclude='*.so*' \
--exclude=expat_config.h \
build_{autotools,cmake}/ROOT
- name: Check for identical exported symbols from both build systems
run: |
list_shared_library_symbols_sh="${GITHUB_WORKSPACE}"/.github/workflows/scripts/list-shared-library-symbols.sh
exported_symbols_txt="${GITHUB_WORKSPACE}"/.github/workflows/data/exported-symbols.txt
set -x
cd expat/expat-*.*.*/
diff -u "${exported_symbols_txt}" <("${list_shared_library_symbols_sh}" build_autotools/ROOT/usr/local/lib*/libexpat.so)
diff -u "${exported_symbols_txt}" <("${list_shared_library_symbols_sh}" build_cmake/ROOT/usr/local/lib*/libexpat.so)