Skip to content

Commit

Permalink
ci: readelf consumer builds
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Jan 5, 2024
1 parent 82d0eb7 commit ad28a10
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
11 changes: 3 additions & 8 deletions .github/test-consumer-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
set -e

# args
[ $# -lt 1 ] && echo "USAGE: $0 [tool] [test args]..." >&2 && exit 2
[ $# -ne 1 ] && echo "USAGE: $0 [tool]" >&2 && exit 2
tool=$1
shift

# source, build, and install directories
source_dir=examples/build_with_$tool
Expand All @@ -15,9 +14,6 @@ install_dir=install-consumer
mkdir -p $install_dir
install_dir=$(cd $install_dir && pwd -P)

# executable
test_executable=iguana-example-00-basic

# print and execute a command
exe() {
echo "--------------------------------------------------"
Expand All @@ -32,18 +28,17 @@ case $tool in
exe cmake -S $source_dir -B $build_dir
exe cmake --build $build_dir
exe cmake --install $build_dir --prefix $install_dir
exe $install_dir/bin/$test_executable "$@"
;;
make)
pushd $source_dir
exe make
popd
exe $source_dir/bin/$test_executable "$@"
mkdir -pv $install_dir/bin
ln -sv $source_dir/bin/* $install_dir/bin/
;;
meson)
exe meson setup --prefix=$install_dir $build_dir $source_dir
exe meson install -C $build_dir
exe $install_dir/bin/$test_executable "$@"
;;
*)
echo "ERROR: unknown tool '$tool'" >&2
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,20 @@ jobs:
- name: set cmake prefix path
if: ${{ matrix.tool == 'cmake' }}
run: echo CMAKE_PREFIX_PATH=$(pwd)/hipo >> $GITHUB_ENV
- name: build and run
- name: build
run: |
source iguana/bin/this_iguana.sh
.github/test-consumer-build.sh ${{ matrix.tool }} test_data.hipo 1
.github/test-consumer-build.sh ${{ matrix.tool }}
- name: readelf/otool executable
run: |
if [ ${{ inputs.runner }} = "macos-latest" ]; then
otool -l install-consumer/bin/iguana-example-00-basic
else
readelf -d install-consumer/bin/iguana-example-00-basic
fi
- name: run
run: |
install-consumer/bin/iguana-example-00-basic test_data.hipo 1
# documentation
#########################################################
Expand Down
2 changes: 1 addition & 1 deletion examples/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ example_sources = [

# add iguana libraries to rpath
example_rpaths = [
'@executable_path' / '..' / get_option('libdir'),
'$ORIGIN' / '..' / get_option('libdir'),
hipo_dep.get_variable(pkgconfig: 'libdir'),
]

Expand Down

0 comments on commit ad28a10

Please sign in to comment.