|
| 1 | +name: main |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + |
| 9 | +jobs: |
| 10 | + validate: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + # Set up vagrant etc. |
| 14 | + # https://github.com/APN-Pucky/gentoo-prefix-tester/blob/1ecbecb7c14efa92b0899e37f32604eea764bdb7/actions/kvm/action.yml#L34-L54 |
| 15 | + |
| 16 | + # https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/ |
| 17 | + - name: Enable KVM group perms |
| 18 | + shell: bash |
| 19 | + run: | |
| 20 | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules |
| 21 | + sudo udevadm control --reload-rules |
| 22 | + sudo udevadm trigger --name-match=kvm |
| 23 | + # https://github.com/jonashackt/vagrant-travisci-libvrt |
| 24 | + # https://wiki.debian.org/Vagrant |
| 25 | + - name: Install libvirt kvm and Vagrant |
| 26 | + shell: bash |
| 27 | + run: | |
| 28 | + sudo apt-get update |
| 29 | + sudo apt-get install -y bridge-utils dnsmasq-base ebtables libvirt-dev qemu-kvm qemu-utils ruby-dev |
| 30 | + sudo apt-get install -y libvirt-daemon-system vagrant-libvirt libvirt-clients |
| 31 | + sudo apt-get install -y virtualbox |
| 32 | + sudo systemctl enable --now libvirtd |
| 33 | + sudo usermod -a -G kvm $USER |
| 34 | + sudo usermod -a -G libvirt $USER |
| 35 | + sudo usermod -a -G libvirt-qemu $USER |
| 36 | + sudo systemctl restart libvirtd |
| 37 | +
|
| 38 | + # End set up vagrant etc. |
| 39 | + |
| 40 | + - uses: actions/checkout@v4 |
| 41 | + |
| 42 | + - name: Cache Vagrant boxes |
| 43 | + id: cache-vagrant |
| 44 | + uses: actions/cache@v3 |
| 45 | + with: |
| 46 | + path: ~/.vagrant.d/boxes |
| 47 | + key: ${{ runner.os }}-vagrant-${{ hashFiles( 'Vagrantfile' ) }} |
| 48 | + restore-keys: | |
| 49 | + ${{ runner.os }}-vagrant- |
| 50 | +
|
| 51 | + - run: vagrant --version |
| 52 | + |
| 53 | + - run: vagrant up --provision |
| 54 | + |
| 55 | + - run: ./scripts/check-pages.py |
0 commit comments