Skip to content

Commit 7ce1929

Browse files
committed
Make GitHub Actions cover "make check" and "make uninstall"
Signed-off-by: Sebastian Pipping <[email protected]>
1 parent f1e40ab commit 7ce1929

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Run the test suite
2+
3+
on:
4+
pull_request:
5+
push:
6+
schedule:
7+
- cron: '0 14 * * 5' # Every Friday 2pm
8+
workflow_dispatch:
9+
10+
# Drop permissions to minimum for security
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
test_suite:
16+
name: Run the test suite
17+
runs-on: ubuntu-24.04
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install dependencies
22+
run: |-
23+
packages=(
24+
# Perl runtime dependencies as documented in README
25+
libcapture-tiny-perl # CPAN Capture::Tiny
26+
libdatetime-perl # CPAN DateTime
27+
libdevel-cover-perl # CPAN Devel::Cover
28+
libdigest-md5-file-perl # CPAN Digest::MD5
29+
libfile-spec-native-perl # CPAN File::Spec
30+
libjson-xs-perl # CPAN JSON::XS
31+
# CPAN Memory::Process, see below
32+
# CPAN Module::Load::Conditional
33+
libscalar-list-utils-perl # CPAN Scalar::Util
34+
# CPAN Time::HiRes
35+
36+
# Additional dependencies for "make check"
37+
llvm # for command "llvm-profdata"
38+
libgd-perl # CPAN GD
39+
python3-coverage # PyPI coverage
40+
python3-xlsxwriter # PyPI xlsxwriter
41+
)
42+
set -x
43+
sudo apt-get update
44+
sudo apt-get install --no-install-recommends --yes -V "${packages[@]}"
45+
sudo perl -MCPAN -e 'install(Memory::Process)' # no package in Ubuntu
46+
47+
- name: make install
48+
run: |-
49+
set -x -o pipefail
50+
make install PREFIX=/usr CFG_DIR=/etc DESTDIR="${PWD}/ROOT"
51+
find ROOT/ | sort | xargs -r ls -ld
52+
53+
- name: make uninstall
54+
run: |-
55+
set -x -o pipefail
56+
make uninstall PREFIX=/usr CFG_DIR=/etc DESTDIR="${PWD}/ROOT"
57+
find ROOT/ | sort | xargs -r ls -ld
58+
diff -u0 <(echo 'total 0') <(ls -l ROOT/) # i.e. fail CI if leftovers
59+
60+
- name: make check
61+
run: |-
62+
set -x -o pipefail
63+
make check
64+
# NOTE: This is a workaround to fail at test failure while
65+
# "make check" fails to exit with non-zero exit code
66+
# in case of failures
67+
grep -F failed tests/test.log | tail -n1 | tee /dev/stderr | grep -F ', 0 failed'

0 commit comments

Comments
 (0)