-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (64 loc) · 2.6 KB
/
integration-tests.yaml
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
name: Integration tests
permissions:
contents: read
on:
workflow_call:
jobs:
integration-test:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup LXD
run: |
sudo snap install lxd --channel=5.21/stable
sudo snap refresh lxd --channel=5.21/stable
sudo lxd waitready
sudo lxd init --auto
sudo chmod a+wr /var/snap/lxd/common/lxd/unix.socket
lxc network set lxdbr0 ipv6.address none
sudo usermod -a -G lxd $USER
echo "Docker LXD workaround"
sudo iptables -F FORWARD
sudo iptables -P FORWARD ACCEPT
# Refresh groups in the current shell
exec sg lxd newgrp $(id -gn)
- name: Setup MicroK8s
run: |
echo "Installing snaps"
sudo snap install microk8s --channel=1.31/stable --classic
sudo snap install kubectl --classic
echo "Starting MicroK8s"
sudo microk8s status --wait-ready --timeout=600
echo "Configuring kubectl"
sudo mkdir -p /home/runner/.kube
sudo microk8s config | sudo tee /home/runner/.kube/config > /dev/null
sudo chown -R $USER:$USER /home/runner/.kube
export KUBECONFIG=/home/runner/.kube/config
echo "Enabling MicroK8s addons"
sudo microk8s enable hostpath-storage
echo "Enabling MicroK8s Multus addons"
sudo microk8s addons repo add community https://github.com/canonical/microk8s-community-addons --reference feat/strict-fix-multus
sudo microk8s enable multus
sudo microk8s kubectl -n kube-system rollout status daemonset/kube-multus-ds
sudo microk8s kubectl auth can-i create network-attachment-definitions
- name: Setup local Docker registry
run: |
sudo snap install docker
sleep 5
docker run -d -p 5000:5000 --name registry registry:2
- name: Download Container image from GitHub Artifact
uses: actions/download-artifact@v4
with:
name: rock
- name: Push container image to local registry
run: |
sudo snap install rockcraft --classic
rock_file=$(ls *.rock | tail -n 1)
sudo rockcraft.skopeo --insecure-policy copy oci-archive:"${rock_file}" docker-daemon:ella-core:latest
docker tag ella-core:latest localhost:5000/ella-core:latest
docker push localhost:5000/ella-core:latest
- name: Run integration tests
run: |
pip install tox
tox -e integration