Skip to content

Commit

Permalink
consolidate ci-test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
falconindy committed Aug 8, 2024
1 parent a81eb0e commit 70c5a37
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/arch.x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- run: build-aux/ci-test
- run: build-aux/ci-test plain

test_asan:
runs-on: ubuntu-latest
Expand All @@ -20,4 +20,4 @@ jobs:

steps:
- uses: actions/checkout@v4
- run: build-aux/ci-test-asan
- run: build-aux/ci-test asan
65 changes: 60 additions & 5 deletions build-aux/ci-test
Original file line number Diff line number Diff line change
@@ -1,16 +1,71 @@
#!/bin/bash -le

debug() {
echo "::debug::$*"
}

error() {
echo "::error::$*"
}

fatal() {
error "$*"
exit 1
}

group() {
echo "::group::$*"
}

endgroup() {
echo "::endgroup::"
}

debug "Running with buildmode=$buildmode"

group 'setup'

buildmode=$1
setup_flags=()
builddir=build-$buildmode
test_install=0

case $buildmode in
plain)
test_install=1
;;
asan)
setup_flags=('-Db_sanitize=address')
;;
*)
fatal "unknown build mode $buildmode"
;;
esac

pacman -Syu --noconfirm base-devel git gmock gtest python meson perl

# Needed to ensure PATH is properly set for perl, etc.
source /etc/profile

endgroup

# build
meson setup build --prefix=/usr --buildtype=debugoptimized
meson compile -C build
group 'build'
meson setup "$builddir" \
--prefix=/usr \
--buildtype=debugoptimized \
"${setup_flags[@]}"
meson compile -C "$builddir"
endgroup

# test
meson test -C build
group 'test'
meson test -C "$builddir"
endgroup

# package
meson install -C build
# install
if (( test_install )); then
group 'install'
meson install -C "$builddir"
endgroup
fi

0 comments on commit 70c5a37

Please sign in to comment.