diff options
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/tests.yml (renamed from .github/workflows/linux.yml) | 66 |
1 files changed, 65 insertions, 1 deletions
diff --git a/.github/workflows/linux.yml b/.github/workflows/tests.yml index 71e0759..d31deeb 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/tests.yml @@ -1,7 +1,7 @@ # Copyright (c) 2023 Sebastian Pipping <sebastian@pipping.org> # Licensed under GPL v2 or later -name: Build on Linux +name: Build and test on: pull_request: @@ -104,3 +104,67 @@ jobs: set -x -o pipefail make install DESTDIR="${PWD}"/ROOT/ find ROOT/ | sort | xargs ls -ld + + vagrant: + name: Run Vagrant tests + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + # TODO: automatically check that this list is up-to-date + box: + - centos8 + - debian10 + - debian11 + #- freebsd12 # https://github.com/mpartel/bindfs/issues/144#issuecomment-1807258383 + - ubuntu1804 + - ubuntu2004 + - ubuntu2204 + steps: + - name: Install dependencies + run: |- + set -x + for FILE in /etc/apt/sources.list /etc/apt/sources.list.d/*; do + if [[ -e "${FILE}" ]]; then + sudo sed -i 's/# deb-src /deb-src /' "${FILE}" + fi + done + + # The following is based on these instructions: + # https://developer.hashicorp.com/vagrant/install?product_intent=vagrant + # https://vagrant-libvirt.github.io/vagrant-libvirt/installation.html + + wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg + echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list + sudo apt-get update + sudo apt-get build-dep vagrant ruby-libvirt + sudo apt-get install -y vagrant \ + qemu-system-x86 \ + autoconf automake libtool pkg-config \ + qemu libvirt-daemon-system ebtables libguestfs-tools \ + libxslt-dev libxml2-dev zlib1g-dev ruby-dev + vagrant plugin install vagrant-libvirt + sudo adduser "${USER}" libvirt + + - name: Checkout Git branch + uses: actions/checkout@v4 + + - name: 'Generate build files with ./autogen.sh' + run: |- + ./autogen.sh + + - name: Check for KVM + run: |- + if [[ -e /dev/kvm ]]; then + echo "This GitHub Action runner has KVM. This run will be fast." + else + echo "This GitHub Action runner does NOT have KVM. This run will be slow." + fi + + - name: Test with Vagrant box ${{ matrix.box }} + env: + VAGRANT_DEFAULT_PROVIDER: libvirt + run: |- + # sudo needed because the current shell is not yet in group "libvirt" + # https://github.com/actions/runner-images/discussions/5981 + sudo -E -s -u "${USER}" vagrant/test.rb --print-logs ${{ matrix.box }} |