renable vbox_guest #17
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: rocky9-vbox-ci | |
on: | |
push: | |
branches: [ "main" ] | |
paths-ignore: | |
- 'README.md' | |
- 'TODO.md' | |
- '**/*.md' | |
- .gitignore | |
pull_request: | |
branches: [ "main" ] | |
paths-ignore: | |
- 'README.md' | |
- '**/*.md' | |
- .gitignore | |
env: | |
build_source_name: rocky-9 | |
box_name: rocky9 | |
box_file: Rocky-9.4-Vagrant-virtualbox.x86_64.box | |
permissions: | |
contents: read | |
jobs: | |
rocky9-vbox: | |
runs-on: ubuntu-20.04 | |
strategy: | |
max-parallel: 5 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Update system | |
run: | | |
sudo apt-get update -y | |
- name: Install VirtualBox 7.0.14 | |
run: | | |
wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --dearmor --yes --output /usr/share/keyrings/oracle-virtualbox-2016.gpg | |
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list | |
sudo apt-get update | |
wget https://download.virtualbox.org/virtualbox/7.0.14/virtualbox-7.0_7.0.14-161095~Ubuntu~$(lsb_release -cs)_amd64.deb | |
sudo apt-get install -y linux-headers-$(uname -r) dkms | |
sudo apt-get install ./virtualbox-7.0_7.0.14-161095~Ubuntu~$(lsb_release -cs)_amd64.deb | |
- name: Verify VirtualBox installation | |
run: VBoxManage --version | |
- name: Install vagrant | |
run: | | |
# Get vagrant gpg key | |
wget -O- 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 apt-get update && sudo apt-get install vagrant -y | |
- name: Verify Vagrant installation | |
run: vagrant --version | |
- name: Setup Packer | |
uses: hashicorp/[email protected] | |
id: setup | |
- name: Verify packer installation | |
run: packer --version | |
- name: Run packer build | |
run: | | |
export USER=$(whoami) | |
export LOGNAME=$(whoami) | |
packer init versions.pkr.hcl | |
packer build -only=virtualbox-iso.${{ env.build_source_name }} . | |
- name: Test to run vagrant box | |
run: | | |
vagrant box add --name ${{ env.box_name }} ${{ env.box_file }} | |
vagrant init ${{ env.box_name }} | |
vagrant up | |
- name: Show running box | |
run: | | |
vagrant box list | |
vagrant global-status | |
- name: Upload vagrant box file | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "${{ env.box_name }}-vagrant-box" | |
path: | | |
${{ env.box_file }} | |
... |