Forgot two sudos #121
This file contains 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: test | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- ".github/workflows/test.yml" | |
- "base/**" | |
- "meta/**" | |
- "templates/**" | |
- "ansible.cfg" | |
- "goss.yaml" | |
- "requirements.txt" | |
- "Vagrantfile" | |
- "variables.yml" | |
- "vars.yaml" | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [focal, jammy, rhel8, rhel9] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Enable KVM group perms | |
run: | | |
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 | |
- name: Cache Vagrant boxes | |
uses: actions/cache@v3 | |
with: | |
path: ~/.vagrant.d/boxes | |
key: ${{ runner.os }}-vagrant-${{ hashFiles('Vagrantfile') }} | |
restore-keys: | | |
${{ runner.os }}-vagrant- | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
cache: pip | |
- name: Run tests in Vagrant | |
run: | | |
sudo apt-get update -qq | |
sudo apt-get install -y virtualbox | |
pip install --upgrade pip | |
python -m venv env | |
source env/bin/activate | |
pip install -r requirements.txt | |
vagrant up ${{ matrix.os }} |