2021-03-22 17:22:02 -04:00
|
|
|
# Copyright (C) 2021 Sebastian Pipping <sebastian@pipping.org>
|
|
|
|
# Licensed under the MIT license
|
|
|
|
|
2021-04-05 09:13:23 -04:00
|
|
|
name: Ensure that GNU Autotools and CMake build systems agree
|
2021-03-22 17:22:02 -04:00
|
|
|
|
|
|
|
on:
|
2021-04-05 12:10:58 -04:00
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 2 * * 5' # Every Friday at 2am
|
2021-03-22 17:22:02 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
checks:
|
2021-04-05 09:13:23 -04:00
|
|
|
name: Ensure that GNU Autotools and CMake build systems agree
|
2021-03-22 17:22:02 -04:00
|
|
|
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
|
|
|
|
|
2021-04-05 09:13:23 -04:00
|
|
|
- name: Produce and extract a release archive
|
2021-03-22 17:22:02 -04:00
|
|
|
run: |
|
|
|
|
set -x
|
2021-04-05 09:13:23 -04:00
|
|
|
cd expat
|
2021-03-22 17:22:02 -04:00
|
|
|
./buildconf.sh
|
|
|
|
./configure
|
|
|
|
make dist
|
2021-03-22 18:46:04 -04:00
|
|
|
tar xf expat-*.*.*.tar.gz
|
2021-03-22 17:22:02 -04:00
|
|
|
|
2021-04-05 09:13:23 -04:00
|
|
|
- name: Build and install using GNU Autotools
|
|
|
|
run: |
|
|
|
|
set -x
|
|
|
|
cd expat/expat-*.*.*/
|
2021-03-22 17:22:02 -04:00
|
|
|
mkdir build_autotools
|
2021-04-05 09:13:23 -04:00
|
|
|
cd build_autotools
|
|
|
|
../configure --libdir='${exec_prefix}/lib123'
|
|
|
|
make install DESTDIR="${PWD}"/ROOT
|
2021-03-22 17:22:02 -04:00
|
|
|
|
2021-04-05 09:13:23 -04:00
|
|
|
- name: Build and install using CMake
|
|
|
|
run: |
|
|
|
|
set -x
|
|
|
|
cd expat/expat-*.*.*/
|
2021-03-22 17:22:02 -04:00
|
|
|
mkdir build_cmake
|
2021-04-05 09:13:23 -04:00
|
|
|
cd build_cmake
|
|
|
|
cmake -DCMAKE_INSTALL_LIBDIR=lib123 ..
|
|
|
|
make install DESTDIR="${PWD}"/ROOT
|
2021-03-22 17:22:02 -04:00
|
|
|
|
2021-04-05 09:13:23 -04:00
|
|
|
- name: Check for identical CMake files from both build systems
|
|
|
|
run: |
|
|
|
|
set -x
|
|
|
|
cd expat/expat-*.*.*/
|
2021-03-22 17:22:02 -04:00
|
|
|
diff \
|
|
|
|
--recursive \
|
|
|
|
--unified \
|
|
|
|
--exclude=xmlwf \
|
|
|
|
--exclude=libexpat.a \
|
|
|
|
--exclude=libexpat.la \
|
|
|
|
--exclude='*.so*' \
|
|
|
|
--exclude=expat_config.h \
|
|
|
|
build_{autotools,cmake}/ROOT
|
2021-04-05 09:29:18 -04:00
|
|
|
|
|
|
|
- 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)
|