Add fzf wrapping script #16
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Functional Tests | |
| on: | |
| pull_request: | |
| types: [labeled, synchronize] | |
| workflow_dispatch: | |
| jobs: | |
| functional: | |
| name: ${{ matrix.name }} | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| contains(github.event.pull_request.labels.*.name, 'run-functional-tests') | |
| runs-on: ubuntu-24.04 | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: "Fedora 43 (x86_64)" | |
| distro: x86_64-f43 | |
| test_extra_args: "--ovs-track" | |
| cargo_cmd_opts: "" | |
| - name: "Fedora Rawhide (x86_64)" | |
| distro: x86_64-rawhide | |
| test_extra_args: "--ovs-track" | |
| cargo_cmd_opts: "" | |
| - name: "CentOS 8 Stream (x86_64)" | |
| distro: x86_64-c8s | |
| test_extra_args: "--ignore=test_ovs.py --ignore=test_nft.py" | |
| cargo_cmd_opts: "--no-default-features" | |
| - name: "CentOS 9 Stream (x86_64)" | |
| distro: x86_64-c9s | |
| test_extra_args: "--ovs-track" | |
| cargo_cmd_opts: "" | |
| - name: "CentOS 10 Stream (x86_64)" | |
| distro: x86_64-c10s | |
| test_extra_args: "--ovs-track" | |
| cargo_cmd_opts: "" | |
| - name: "Ubuntu Jammy (x86_64)" | |
| distro: x86_64-jammy | |
| test_extra_args: "" | |
| cargo_cmd_opts: "" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Change KVM perms | |
| run: | | |
| # Grant rw access to /dev/kvm via udev rule. | |
| # GitHub-hosted runners are not in the kvm group by default. | |
| # See https://github.com/orgs/community/discussions/8305 | |
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | \ | |
| sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| sudo udevadm control --reload-rules | |
| sudo udevadm trigger --name-match=kvm | |
| ls -l /dev/kvm | |
| - name: Compute weekly cache key | |
| run: | | |
| # Invalidate once a week: key is the date of last Monday. | |
| echo "WEEK_KEY=$(date -d 'last monday' +%Y%m%d)" >> $GITHUB_ENV | |
| - name: Cache Vagrant boxes | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.vagrant.d/boxes | |
| key: vagrant-boxes-${{ matrix.distro }}-${{ env.WEEK_KEY }}-${{ hashFiles('Vagrantfile') }} | |
| restore-keys: | | |
| vagrant-boxes-${{ matrix.distro }}-${{ env.WEEK_KEY }} | |
| vagrant-boxes-${{ matrix.distro }} | |
| - name: Install Vagrant | |
| run: | | |
| # Install Vagrant from Hashicorp directly. | |
| # The version shipped with Ubuntu fails to download some boxes. | |
| # See https://bugs.launchpad.net/vagrant/+bug/2017828. | |
| wget -O- https://apt.releases.hashicorp.com/gpg | \ | |
| 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 DEBIAN_FRONTEND=noninteractive apt-get -y update | |
| sudo DEBIAN_FRONTEND=noninteractive apt-get -y install \ | |
| vagrant ruby-libvirt qemu-kvm virt-manager libvirt-daemon-system \ | |
| virtinst libvirt-clients bridge-utils pkg-config libxslt-dev \ | |
| libxml2-dev libvirt-dev zlib1g-dev ruby-dev gcc make ruby-nokogiri | |
| vagrant plugin install vagrant-libvirt | |
| sudo systemctl enable --now libvirtd | |
| # Grant the runner user access to the libvirt socket directly, | |
| # avoiding the need for group membership and re-login. | |
| sudo chmod a+rw /var/run/libvirt/libvirt-sock | |
| - name: Boot VM | |
| env: | |
| DISTRO: ${{ matrix.distro }} | |
| run: | | |
| vagrant box update -f ${DISTRO} | |
| vagrant box prune -f | |
| # Retry once to overcome transient network glitches. | |
| vagrant up ${DISTRO} --no-tty || vagrant up ${DISTRO} --no-tty | |
| vagrant halt --no-tty ${DISTRO} || vagrant halt --no-tty --force ${DISTRO} | |
| # Restart the VM after the update without reprovisioning. | |
| vagrant up --no-tty --no-provision ${DISTRO} | |
| mkdir -p -m 0700 ~/.ssh | |
| vagrant ssh-config ${DISTRO} >> ~/.ssh/config | |
| - name: Guest info | |
| env: | |
| DISTRO: ${{ matrix.distro }} | |
| run: | | |
| echo "--- Host info ---" | |
| ssh ${DISTRO} 'sh -exc "uname -a"' | |
| - name: Run functional tests | |
| env: | |
| DISTRO: ${{ matrix.distro }} | |
| TEST_EXTRA_ARGS: ${{ matrix.test_extra_args }} | |
| CARGO_CMD_OPTS: ${{ matrix.cargo_cmd_opts }} | |
| run: | | |
| ssh -tt ${DISTRO} "env CARGO_CMD_OPTS=$CARGO_CMD_OPTS bash --login -exc 'cd /vagrant && make V=1'" | |
| ssh -tt ${DISTRO} "cd /vagrant/tests && sudo python3 -m pytest ${TEST_EXTRA_ARGS}" | |
| ssh -tt ${DISTRO} "bash --login -exc 'cd /vagrant && sudo make functional-tests'" | |
| - name: Teardown VM | |
| if: always() | |
| env: | |
| DISTRO: ${{ matrix.distro }} | |
| run: vagrant destroy -f ${DISTRO} || true |