88jobs :
99 build :
1010 name : Create snap package
11- runs-on : ubuntu-20 .04
11+ runs-on : ubuntu-22 .04
1212
1313 steps :
1414 - name : Checking out repo
1818 sudo lxd init --auto
1919 sudo usermod --append --groups lxd $USER
2020 sg lxd -c 'lxc version'
21+ # Docker sets iptables rules that interfere with LXD or K8s.
22+ # https://documentation.ubuntu.com/lxd/en/latest/howto/network_bridge_firewalld/#prevent-connectivity-issues-with-lxd-and-docker
23+ - name : Apply Docker iptables workaround
24+ shell : bash
25+ run : sudo iptables -I DOCKER-USER -j ACCEPT
2126 - name : Install snapcraft
2227 run : |
2328 sudo snap install snapcraft --classic
@@ -37,138 +42,84 @@ jobs:
3742
3843 test-upgrade :
3944 name : Upgrade path test
40- runs-on : ubuntu-20 .04
45+ runs-on : ubuntu-22 .04
4146 needs : build
42-
47+ timeout-minutes : 30
4348 steps :
4449 - name : Checking out repo
4550 uses : actions/checkout@v4
46- - name : Install test dependencies
47- run : |
48- set -x
49- sudo apt-get install python3-setuptools
50- sudo pip3 install --upgrade pip
51- sudo pip3 install -U pytest sh psutil
52- sudo apt-get -y install open-iscsi
53- sudo systemctl enable iscsid
54- - name : Fetch snap
55- uses : actions/download-artifact@v4
56- with :
57- name : microk8s.snap
58- path : build
51+ - name : Prepare test prerequisites
52+ uses : ./.github/actions/test-prep
5953 - name : Running upgrade path test
6054 run : |
6155 sudo -E UPGRADE_MICROK8S_FROM=latest/edge UPGRADE_MICROK8S_TO=$PWD/build/microk8s.snap pytest -s ./tests/test-upgrade-path.py
6256
6357 test-addons-core :
6458 name : Test core addons
65- runs-on : ubuntu-20 .04
59+ runs-on : ubuntu-22 .04
6660 needs : build
67-
61+ timeout-minutes : 30
6862 steps :
6963 - name : Checking out repo
7064 uses : actions/checkout@v4
71- - name : Install test dependencies
72- run : |
73- set -x
74- sudo apt-get install python3-setuptools
75- sudo pip3 install --upgrade pip
76- sudo pip3 install -U pytest==8.3.4 sh psutil
77- sudo apt-get -y install open-iscsi
78- sudo systemctl enable iscsid
79- - name : Fetch snap
80- uses : actions/download-artifact@v4
81- with :
82- name : microk8s.snap
83- path : build
65+ - name : Prepare test prerequisites
66+ uses : ./.github/actions/test-prep
8467 - name : Running addons tests
68+ env :
69+ UNDER_TIME_PRESSURE : ${{ !contains(github.event.pull_request.labels.*.name, 'run-all-tests') }}
8570 run : |
8671 set -x
8772 sudo snap install build/microk8s.snap --classic --dangerous
8873 ./tests/smoke-test.sh
89- export UNDER_TIME_PRESSURE="True"
9074 export SKIP_PROMETHEUS="False"
9175 sudo -E bash -c "cd /var/snap/microk8s/common/addons/core/tests; pytest -s -ra test-addons.py"
9276
9377 test-addons-community :
9478 name : Test community addons
95- runs-on : ubuntu-20 .04
79+ runs-on : ubuntu-22 .04
9680 needs : build
97-
81+ timeout-minutes : 30
9882 steps :
9983 - name : Checking out repo
10084 uses : actions/checkout@v4
101- - name : Install test dependencies
102- run : |
103- set -x
104- sudo apt-get install python3-setuptools
105- sudo pip3 install --upgrade pip
106- sudo pip3 install -U pytest sh
107- sudo apt-get -y install open-iscsi
108- sudo systemctl enable iscsid
109- - name : Fetch snap
110- uses : actions/download-artifact@v4
111- with :
112- name : microk8s.snap
113- path : build
114- # - name: Setup tmate session
115- # uses: mxschmitt/action-tmate@v3
85+ - name : Prepare test prerequisites
86+ uses : ./.github/actions/test-prep
11687 - name : Running addons tests
88+ env :
89+ UNDER_TIME_PRESSURE : ${{ !contains(github.event.pull_request.labels.*.name, 'run-all-tests') }}
11790 run : |
11891 set -x
11992 sudo snap install build/microk8s.snap --classic --dangerous
12093 sudo microk8s enable community
121- export UNDER_TIME_PRESSURE="True"
12294 sudo -E bash -c "cd /var/snap/microk8s/common/addons/community/; pytest -s -ra ./tests/"
12395
12496 test-addons-core-upgrade :
12597 name : Test core addons upgrade
126- runs-on : ubuntu-20 .04
98+ runs-on : ubuntu-22 .04
12799 needs : build
128-
100+ timeout-minutes : 30
129101 steps :
130102 - name : Checking out repo
131103 uses : actions/checkout@v4
132- # - name: Setup tmate session
133- # uses: mxschmitt/action-tmate@v3
134- - name : Install test dependencies
135- run : |
136- set -x
137- sudo apt-get install python3-setuptools
138- sudo pip3 install --upgrade pip
139- sudo pip3 install -U pytest sh psutil
140- sudo apt-get -y install open-iscsi
141- sudo systemctl enable iscsid
142- - name : Fetch snap
143- uses : actions/download-artifact@v4
144- with :
145- name : microk8s.snap
146- path : build
104+ - name : Prepare test prerequisites
105+ uses : ./.github/actions/test-prep
147106 - name : Running upgrade tests
107+ env :
108+ UNDER_TIME_PRESSURE : ${{ !contains(github.event.pull_request.labels.*.name, 'run-all-tests') }}
148109 run : |
149110 set -x
150- export UNDER_TIME_PRESSURE="True"
151111 sudo -E bash -c "UPGRADE_MICROK8S_FROM=latest/edge UPGRADE_MICROK8S_TO=$PWD/build/microk8s.snap pytest -s ./tests/test-upgrade.py"
152112
153113 test-cluster-agent :
154114 name : Cluster agent health check
155- runs-on : ubuntu-20 .04
115+ runs-on : ubuntu-22 .04
156116 needs : build
157-
117+ timeout-minutes : 30
158118 steps :
159119 - name : Checking out repo
160120 uses : actions/checkout@v4
161- - name : Install test dependencies
162- run : |
163- set -x
164- sudo apt-get install python3-setuptools
165- sudo pip3 install --upgrade pip
166- sudo pip3 install -U pytest sh requests
167- - name : Fetch snap
168- uses : actions/download-artifact@v4
169- with :
170- name : microk8s.snap
171- path : build
121+ - name : Prepare test prerequisites
122+ uses : ./.github/actions/test-prep
172123 - name : Running cluster agent health check
173124 run : |
174125 set -x
@@ -177,17 +128,14 @@ jobs:
177128
178129 test-airgap :
179130 name : Test airgap installation
180- runs-on : ubuntu-20 .04
131+ runs-on : ubuntu-22 .04
181132 needs : build
182-
133+ timeout-minutes : 30
183134 steps :
184135 - name : Checking out repo
185136 uses : actions/checkout@v4
186- - name : Fetch snap
187- uses : actions/download-artifact@v4
188- with :
189- name : microk8s.snap
190- path : build
137+ - name : Prepare test prerequisites
138+ uses : ./.github/actions/test-prep
191139 - name : Initialize LXD
192140 run : |
193141 sudo lxd init --auto
@@ -196,12 +144,13 @@ jobs:
196144 sg lxd -c 'lxc version'
197145 - name : Run airgap tests
198146 run : |
199- sudo -E bash -x -c "./tests/libs/airgap.sh --distro ubuntu:20 .04 --channel $PWD/build/microk8s.snap"
147+ sudo -E bash -x -c "./tests/libs/airgap.sh --distro ubuntu:22 .04 --channel $PWD/build/microk8s.snap"
200148
201149 security-scan :
202150 name : Security scan
203- runs-on : ubuntu-20 .04
151+ runs-on : ubuntu-22 .04
204152 needs : build
153+ timeout-minutes : 30
205154 steps :
206155 - name : Checking out repo
207156 uses : actions/checkout@v4
0 commit comments