Skip to content

Commit 8d55c20

Browse files
committed
github: Add a basic github CI test
This builds libguestfs and runs the in-tree tests, ie. the basic './configure && make && make check'. We're using the "free for public repositories" plan. The only free runner available is Ubuntu-based (noble). The tests are run on pushes to the master branch, and on pull requests to the master branch. GObject is not built, since the tests fail and anyway there are some deep problems with the GObject bindings and they probably will be removed.
1 parent e7b36e0 commit 8d55c20

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

.github/workflows/main.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Run the job below on every push to master branch.
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
10+
# Runs basic configure, make and make check.
11+
jobs:
12+
tests:
13+
name: Build and run the tests
14+
runs-on: ubuntu-latest
15+
steps:
16+
17+
- name: Enable source repositories
18+
run: |
19+
sudo sed -i 's/Types: deb$/Types: deb deb-src/g' \
20+
/etc/apt/sources.list.d/ubuntu.sources
21+
22+
- name: Install build dependencies
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get -y build-dep libguestfs
26+
27+
- name: Install extra dependencies
28+
run: |
29+
# Git is needed to run git submodule command.
30+
# json-c is missing from the Ubuntu package deps.
31+
sudo apt-get -y install git libjson-c-dev
32+
33+
- name: Fix broken Ubuntu kernel permissions
34+
run: |
35+
# https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725
36+
sudo chmod 0644 /boot/vmlinuz*
37+
38+
- name: Enable KVM
39+
run: |
40+
sudo chmod 0666 /dev/kvm
41+
42+
- name: Checkout sources
43+
uses: actions/checkout@v2
44+
45+
- name: Checkout submodule
46+
run: |
47+
git submodule update --init
48+
49+
- name: Compile the code
50+
run: |
51+
autoreconf -fiv
52+
./configure --disable-gobject
53+
make -j
54+
55+
- name: Run the quick test
56+
run: |
57+
make quickcheck
58+
59+
- name: Run the full tests
60+
run: |
61+
# grub-install: error: /usr/lib/grub/i386-pc/modinfo.sh
62+
# doesn't exist. Please specify --target or --directory
63+
export SKIP_TEST_GRUB_INSTALL_0=1
64+
# Errors from hexdump, maybe not installed?
65+
export SKIP_TEST_HEXDUMP_0=1
66+
export SKIP_TEST_HEXDUMP_1=1
67+
export SKIP_TEST_HEXDUMP_2=1
68+
# error: luks_close: cryptsetup exited with status 5:
69+
# Device lukstest is still in use
70+
export SKIP_TEST_LUKS_SH=1
71+
# error: passt exited with status 1
72+
export SKIP_TEST_NETWORK_SH=1
73+
# error: passt exited with status 1
74+
export SKIP_TEST_RSYNC_SH=1
75+
if ! make check; then
76+
find -name test-suite.log -exec cat {} \;
77+
exit 1
78+
fi

0 commit comments

Comments
 (0)