Skip to content

Commit

Permalink
switch to ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
Giancarmine committed Aug 30, 2024
1 parent 65f17e6 commit 42dc4dc
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/.actions/vagrant-setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Setup Vagrant and Libvirt"
description: "A composite action that installs latest versions of vagrant and libvirt for use on ubuntu based runners"
runs:
using: "composite"
steps:
- name: Add vagrant to apt-get sources
shell: bash
run: |
curl -fsSL 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 sed -i 's/^# deb-src/deb-src/' /etc/apt/sources.list
- name: Install vagrant and libvirt
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y libvirt-daemon libvirt-daemon-system vagrant
sudo systemctl enable --now libvirtd
- name: Build vagrant dependencies
shell: bash
run: |
sudo apt-get build-dep -y vagrant ruby-libvirt
sudo apt-get install -y --no-install-recommends libxslt-dev libxml2-dev libvirt-dev ruby-bundler ruby-dev zlib1g-dev
# This is a workaround for the libvirt group not being available in the current shell
# https://github.com/actions/runner-images/issues/7670#issuecomment-1900711711
- name: Make the libvirt socket rw accessible to everyone
shell: bash
run: |
sudo chmod a+rw /var/run/libvirt/libvirt-sock
- name: Install vagrant-libvirt plugin
shell: bash
run: vagrant plugin install vagrant-libvirt
5 changes: 4 additions & 1 deletion .github/workflows/vagrant-up.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ on: [push]

jobs:
vagrant-up:
runs-on: macos-12
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up vagrant and libvirt
uses: ./.github/actions/vagrant-setup

- name: Cache Vagrant boxes
uses: actions/cache@v4
with:
Expand Down

0 comments on commit 42dc4dc

Please sign in to comment.