Skip to content

Move deployment tests to CI-run and re-enable integration tests #123

Move deployment tests to CI-run and re-enable integration tests

Move deployment tests to CI-run and re-enable integration tests #123

Workflow file for this run

---
name: Vagrant (KVM) Tests
on:
pull_request:
push:
branches:
- main
jobs:
test-kvm:
name: KVM Test
runs-on: "cirun-runner--${{ github.run_id }}"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
- name: Install system dependencies
# avoid missing internet adapter error
run: |
sudo apt-get update
sudo apt-get install net-tools -y
- name: Install dependencies
run: |
pip install ansible
- name: Install Ansible dependencies
run: |
ansible-galaxy collection install -r requirements.yaml
- name: Create deploy folder and move inventory files
run: |
mkdir deploy
cp -r inventory.template/* deploy/
cp .github/inventory.ini deploy/inventory.ini
- name: Display internet adaptors
run: |
ip a >> network_info.txt
cat network_info.txt
- name: Extract Network Information
run: |
chmod +x .github/scripts/extract_network_info.sh
./.github/scripts/extract_network_info.sh
echo "adapter_name=$(cat network_info.txt | head -2 | awk '{print $2}')" >> $GITHUB_ENV
echo "ip_range=$(cat network_info.txt | head -2 | awk '{print $3}')" >> $GITHUB_ENV
- name: Update Firewall IP range and Host network adapter
run: |
echo "firewall_internal_ip_range: $ip_range" >> deploy/group_vars/all.yaml
echo "internal_interface: $adapter_name" >> deploy/group_vars/all.yaml
- name: Run ansible playbook
run: |
cd deploy
ansible-playbook ../playbook.yaml -i inventory.ini --connection=local -v
env:
ANSIBLE_FORCE_COLOR: True