-
-
Notifications
You must be signed in to change notification settings - Fork 20
97 lines (82 loc) · 2.55 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Tests
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
end-to-end:
name: End to end testing
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
os:
- centos/9-Stream
- debian/12
- ubuntu/20.04
- ubuntu/22.04
- ubuntu/24.04
runs-on:
- self-hosted
- cpu-16
- mem-32G
- disk-100G
- arch-amd64
- image-debian-12
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get install --no-install-recommends --yes \
ansible \
ceph-base \
ceph-common \
python3-jmespath
- name: Setup Incus
run: |
curl https://pkgs.zabbly.com/get/incus-daily | sudo sh
sudo chmod 666 /var/lib/incus/unix.socket
incus admin init --auto
- name: Setup OpenTofu
run: |
curl -sL https://get.opentofu.org/install-opentofu.sh -o install-opentofu.sh
chmod +x install-opentofu.sh
./install-opentofu.sh --install-method deb
rm -f install-opentofu.sh
- name: Create the test VMs
run: |
cd terraform
tofu init
tofu apply -auto-approve -target=module.baremetal -var incus_image=${{ matrix.os }}
- name: Waiting for VMs to boot up
run: |
sleep 1m
- name: Deploy the test VMs
run: |
cd ansible
if [ "${{ matrix.os }}" = "centos/9-Stream" ]; then
cp hosts.yaml.example.centos hosts.yaml
else
cp hosts.yaml.example hosts.yaml
fi
ansible-playbook tasks/update-packages.yaml
if [ "${{ matrix.os }}" = "ubuntu/20.04" ]; then
# Ubuntu 20.04's OVN is too old.
sed -i "s/ovn_release:.*/ovn_release: \"ppa\"/g" hosts.yaml
elif [ "${{ matrix.os }}" = "debian/12" ]; then
# ZFS on Debian needs compiling which is slow, use btrfs instead
sed -i "s/driver: zfs/driver: btrfs/g" hosts.yaml
fi
ansible-playbook deploy.yaml
- name: Post deployment validation
run: |
export INCUS_PROJECT=dev-incus-deploy
incus exec server01 -- incus launch images:debian/12 c1
sleep 30s
incus list
incus exec server01 -- incus exec c1 -- ping -4 -W1 -c4 linuxcontainers.org
incus exec server01 -- incus exec c1 -- ping -6 -W1 -c4 linuxcontainers.org