Skip to content

Commit

Permalink
Add GH workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
binary-manu committed Sep 22, 2024
1 parent 20e673c commit 504719e
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/actions/runner-cleanup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'runner-cleanup'
description: 'Clean leftover VMs nd prepare configuration files'
runs:
using: "composite"
steps:
- name: Delete all existing VirtualBox VMs
shell: bash
run: |
VBoxManage list vms |
sed 's/.*{\([-[:xdigit:]]\+\)}$/\1/' |
xargs -I% sh -c "VBoxManage controlvm % poweroff; sleep 3; VBoxManage unregistervm % --delete"
- name: Delete existing virsh VMs
shell: bash
run: |
virsh list --all --name |
xargs -I% sh -c "virsh destroy %; sleep 3; virsh undefine % --remove-all-storage"
- name: Add Ansible configuration for pkgproxy
shell: bash
run: |
echo 'custom_repos_servers: ["http://10.0.2.2:8080/$repo/os/$arch"]' > ansible/group_vars/all/99-ci-pkgproxy.yaml
- name: Add Ansible variables for testing
shell: bash
run: |
echo '
global_portable_image: true
bluetooth_override: active
xfce_user_customizations_kvantum_theme: KvAdaptaDark
xscreensaver_override: active
' > ansible/group_vars/all/90-ci-defaults.yaml
44 changes: 44 additions & 0 deletions .github/workflows/test-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Test the playbook

on:
push:
branches:
- ci

jobs:
install_media:
runs-on: [self-hosted, linux]
strategy:
matrix:
config:
- disksetup: disksetup/mbr_singlepart/
provider: virtualbox-iso
- disksetup: disksetup/mbr_lvm/
provider: qemu
- disksetup: disksetup/bios_gpt_btrfs/
provider: virtualbox-iso
- disksetup: disksetup/gpt_singlepart/
provider: virtualbox-uefi
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/runner-cleanup
- name: Select the partitioning flow
run: |
echo 'disksetup_roles_prefix: ${{ matrix.config.disksetup }}' > ansible/group_vars/all/91-ci-disksetup.yaml
- name: Perform system installation
run: |
cd packer
./packer-wrapper.sh build -only=${{ matrix.config.provider }} -timestamp-ui packer-template.json
vagrant_provision:
runs-on: [self-hosted, linux]
strategy:
matrix:
provider: [virtualbox, libvirt]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/runner-cleanup
- name: Bring Vagrant VM up
run: |
cd vagrant
vagrant up --provider ${{ matrix.provider }}

0 comments on commit 504719e

Please sign in to comment.