-
-
Notifications
You must be signed in to change notification settings - Fork 46
109 lines (105 loc) · 3.31 KB
/
ci-ubuntu-latest.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
98
99
100
101
102
103
104
105
106
107
108
109
name: virtnbdbackup CI on ubuntu-22.04
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: abbbi/github-actions-tune@v1
- name: codespell
run: |
sudo apt-get update
sudo apt-get install codespell -y
codespell libvirtnbdbackup
codespell virtnbdbackup
codespell virtnbdrestore
codespell virtnbdmap
codespell virtnbd-nbdkit-plugin
codespell README.md
codespell Changelog
- name: Python code format test
run: |
sudo pip3 install black==22.3
black --check .
black --check virtnbdbackup
black --check virtnbdrestore
black --check virtnbdmap
black --check virtnbd-nbdkit-plugin
- name: Python lint test
run: |
sudo pip3 install pylint==2.14.5
pylint libvirtnbdbackup
- name: Python typing tests
run: |
sudo pip3 install mypy
sudo pip3 install types-paramiko
mypy --ignore-missing libvirtnbdbackup
mypy --ignore-missing virtnbdbackup
mypy --ignore-missing virtnbdrestore
mypy --ignore-missing virtnbdmap
- name: Set up ssh access to localhost
run: |
sudo hostname -f
sudo hostname
sudo ssh-keygen -f /root/.ssh/id_rsa -N ""
sudo cat /root/.ssh/id_rsa.pub | sudo tee -a /root/.ssh/authorized_keys
sudo ssh-keyscan -H localhost | sudo tee -a /root/.ssh/known_hosts
sudo ssh -l root localhost true
sudo ssh-agent | sudo tee -a /root/agent
sudo -- bash -c 'source /root/agent; ssh-add'
- name: Set up libvirt
run: |
sudo apt-get update
sudo apt-get install -y \
apparmor-profiles \
bridge-utils \
dnsmasq-base \
ebtables \
libarchive-tools \
libguestfs-tools \
libvirt-clients \
libvirt-daemon \
libvirt-daemon-system \
qemu-kvm \
qemu-utils \
python3-libnbd \
python3-tqdm \
python3-lz4 \
python3-libvirt \
python3-lxml \
python3-paramiko\
python3-scp \
nbdkit \
nbdkit-plugin-python \
unzip \
libnbd-bin \
;
# start daemon
echo 'security_driver = "none"' | sudo tee -a /etc/libvirt/qemu.conf
sudo aa-teardown
sudo rm -f /etc/apparmor.d/libvirt/libvirt*
sudo systemctl start libvirtd
sudo systemctl restart libvirtd
sudo modprobe nbd max_partitions=10
- name: Execute tests (vm1)
run: cd t && sudo -E make vm1.tests && cd -
- name: Execute tests (vm3)
run: cd t && sudo -E make vm3.tests && cd -
- name: Execute tests (vm4)
run: cd t && sudo -E make vm4.tests && cd -
- name: Perform installation
run: sudo python3 setup.py install
- name: Execute commands
run: virtnbdbackup -h && virtnbdrestore -h
- name: Create log archive
if: always()
run: |
sudo find /tmp/ -type d -name '.guestfs-*' | sudo xargs rm -rf
sudo tar -czvf /log.tar.gz /tmp/tmp.*
sudo chmod go+r /log.tar.gz
- name: Archive Test Results
if: always()
uses: actions/upload-artifact@v1
with:
name: test-results
path: /log.tar.gz